]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/doc/api/openapi.yaml
Fix boolean types, add missing downloadEnabled
[github/Chocobozzz/PeerTube.git] / support / doc / api / openapi.yaml
CommitLineData
3e9e6f2f 1openapi: 3.0.0
1569a818 2info:
5e1c08eb 3 title: PeerTube
b43d19cf 4 version: 2.4.0
2963c343
RK
5 contact:
6 name: PeerTube Community
7 url: 'https://joinpeertube.org'
8 license:
9 name: AGPLv3.0
10 url: 'https://github.com/Chocobozzz/PeerTube/blob/master/LICENSE'
11 x-logo:
12 url: 'https://joinpeertube.org/img/brand.png'
5776f78e 13 altText: PeerTube Project Homepage
2963c343
RK
14 description: |
15 # Introduction
002df381 16
b029d58a 17 The PeerTube API is built on HTTP(S) and is RESTful. You can use your favorite
06746a8b 18 HTTP/REST library for your programming language to use PeerTube. The spec API is fully compatible with
5776f78e 19 [openapi-generator](https://github.com/OpenAPITools/openapi-generator/wiki/API-client-generator-HOWTO)
06746a8b
RK
20 which generates a client SDK in the language of your choice - we generate some client SDKs automatically:
21
22 - [Python](https://framagit.org/framasoft/peertube/clients/python)
23 - [Go](https://framagit.org/framasoft/peertube/clients/go)
24 - [Kotlin](https://framagit.org/framasoft/peertube/clients/kotlin)
3e9e6f2f 25
b029d58a
C
26 See the [Quick Start guide](https://docs.joinpeertube.org/#/api-rest-getting-started) so you can play with the PeerTube API.
27
2963c343 28 # Authentication
002df381 29
2963c343 30 When you sign up for an account, you are given the possibility to generate
1fd12c7c 31 sessions, and authenticate using this session token. One session token can
2963c343 32 currently be used at a time.
5776f78e 33
84f6e32c
RK
34 ## Roles
35
36 Accounts are given permissions based on their role. There are three roles on
37 PeerTube: Administrator, Moderator, and User. See the [roles guide](https://docs.joinpeertube.org/#/admin-managing-users?id=roles) for a detail of their permissions.
38
5776f78e 39 # Errors
002df381 40
5776f78e
RK
41 The API uses standard HTTP status codes to indicate the success or failure
42 of the API call. The body of the response will be JSON in the following
43 format.
44
45 ```
46 {
47 "code": "unauthorized_request", // example inner error code
48 "error": "Token is invalid." // example exposed error message
49 }
50 ```
6441981b 51externalDocs:
512a5759 52 url: https://docs.joinpeertube.org/api-rest-reference.html
2963c343
RK
53tags:
54 - name: Accounts
3e9e6f2f 55 description: >
1e904cde 56 Accounts encompass remote accounts discovered across the federation,
84f6e32c
RK
57 and correspond to the main Actor, along with video channels a user can create, which
58 are also Actors.
59
60 When a comment is posted, it is done with your Account's Actor.
61 - name: Users
62 description: >
63 Using some features of PeerTube require authentication, for which User
3e9e6f2f 64 provide different levels of permission as well as associated user
84f6e32c
RK
65 information. Each user has a corresponding local Account for federation.
66 - name: My User
67 description: >
68 Operations related to your own User, when logged-in.
69 - name: My Subscriptions
70 description: >
71 Operations related to your subscriptions to video channels, their
72 new videos, and how to keep up to date with their latest publications!
73 - name: My Notifications
74 description: >
75 Notifications following new videos, follows or reports. They allow you
76 to keep track of the interactions and overall important information that
77 concerns you. You MAY set per-notification type delivery preference, to
78 receive the info either by mail, by in-browser notification or both.
2963c343 79 - name: Config
3e9e6f2f
RK
80 description: >
81 Each server exposes public information regarding supported videos and
82 options.
2963c343 83 - name: Job
3e9e6f2f
RK
84 description: >
85 Jobs are long-running tasks enqueued and processed by the instance
5776f78e 86 itself. No additional worker registration is currently available.
b029d58a 87 - name: Instance Follows
3e9e6f2f
RK
88 description: >
89 Managing servers which the instance interacts with is crucial to the
5776f78e 90 concept of federation in PeerTube and external video indexation. The PeerTube
1fd12c7c 91 server then deals with inter-server ActivityPub operations and propagates
2963c343
RK
92 information across its social graph by posting activities to actors' inbox
93 endpoints.
84f6e32c
RK
94 externalDocs:
95 url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-follows
04b703f6
RK
96 - name: Instance Redundancy
97 description: >
98 Redundancy is part of the inter-server solidarity that PeerTube fosters.
99 Manage the list of instances you wish to help by seeding their videos according
100 to the policy of video selection of your choice. Note that you have a similar functionality
101 to mirror individual videos, see `Video Mirroring`.
84f6e32c
RK
102 externalDocs:
103 url: https://docs.joinpeertube.org/#/admin-following-instances?id=instances-redundancy
7461d440
RK
104 - name: Plugins
105 description: >
84f6e32c
RK
106 Managing plugins installed from a local path or from NPM, or search for new ones.
107 externalDocs:
108 url: https://docs.joinpeertube.org/#/api-plugins
310b5219 109 - name: Abuses
2963c343 110 description: |
310b5219 111 Abuses deal with reports of local or remote videos/comments/accounts alike.
2963c343
RK
112 - name: Video
113 description: |
114 Operations dealing with listing, uploading, fetching or modifying videos.
115 - name: Search
116 description: |
ad031145 117 The search helps to find _videos_ or _channels_ from within the instance and beyond.
2963c343
RK
118 Videos from other instances federated by the instance (that is, instances
119 followed by the instance) can be found via keywords and other criteria of
120 the advanced search.
ad031145
C
121
122 Administrators can also enable the use of a remote search system, indexing
123 videos and channels not could be not federated by the instance.
b029d58a 124 - name: Video Comments
3e9e6f2f
RK
125 description: >
126 Operations dealing with comments to a video. Comments are organized in
127 threads.
b029d58a 128 - name: Video Playlists
71810d0b
RK
129 description: >
130 Operations dealing with playlists of videos. Playlists are bound to users
131 and/or channels.
b029d58a 132 - name: Video Channels
3e9e6f2f 133 description: >
d73810be 134 Operations dealing with the creation, modification and listing of videos within a channel.
06746a8b 135 - name: Video Blocks
5776f78e 136 description: >
d73810be 137 Operations dealing with blocking videos (removing them from view and
5776f78e 138 preventing interactions).
b029d58a 139 - name: Video Rates
5776f78e 140 description: >
b029d58a 141 Like/dislike a video.
06746a8b
RK
142 - name: Feeds
143 description: >
144 Server syndication feeds
5776f78e
RK
145x-tagGroups:
146 - name: Accounts
147 tags:
148 - Accounts
b029d58a 149 - Users
1f82e3e8 150 - My User
b029d58a 151 - My Subscriptions
f4d59981 152 - My Notifications
5776f78e
RK
153 - name: Videos
154 tags:
155 - Video
04b703f6 156 - Video Captions
b029d58a
C
157 - Video Channels
158 - Video Comments
b029d58a
C
159 - Video Rates
160 - Video Playlists
161 - Video Ownership Change
04b703f6 162 - Video Mirroring
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
cd372e84 1310 type: boolean
3e9e6f2f 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
cd372e84
A
1334 downloadEnabled:
1335 description: Enable or disable downloading for this video
1336 type: boolean
f9f89092
FS
1337 originallyPublishedAt:
1338 description: Date when the content was originally published
1339 type: string
1340 format: date-time
5dce26d2
C
1341 scheduleUpdate:
1342 $ref: '#/components/schemas/VideoScheduledUpdate'
3e9e6f2f
RK
1343 required:
1344 - videofile
1345 - channelId
8f9e8be1 1346 - name
0ad45af7
FS
1347 encoding:
1348 videofile:
1349 contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream
1350 thumbnailfile:
1351 contentType: image/jpeg
1352 previewfile:
1353 contentType: image/jpeg
8f9e8be1
RK
1354 x-code-samples:
1355 - lang: Shell
1356 source: |
0579dee3 1357 ## DEPENDENCIES: jq
8f9e8be1
RK
1358 USERNAME="<your_username>"
1359 PASSWORD="<your_password>"
1360 FILE_PATH="<your_file_path>"
1361 CHANNEL_ID="<your_channel_id>"
8f9e8be1
RK
1362 NAME="<video_name>"
1363
1364 API_PATH="https://peertube2.cpy.re/api/v1"
1365 ## AUTH
0579dee3
JK
1366 client_id=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_id")
1367 client_secret=$(curl -s "$API_PATH/oauth-clients/local" | jq -r ".client_secret")
1368 token=$(curl -s "$API_PATH/users/token" \
1369 --data client_id="$client_id" \
1370 --data client_secret="$client_secret" \
1371 --data grant_type=password \
1372 --data response_type=code \
1373 --data username="$USERNAME" \
1374 --data password="$PASSWORD" \
8f9e8be1
RK
1375 | jq -r ".access_token")
1376 ## VIDEO UPLOAD
0579dee3
JK
1377 curl -s "$API_PATH/videos/upload" \
1378 -H "Authorization: Bearer $token" \
1379 --max-time 600 \
1380 --form videofile=@"$FILE_PATH" \
1381 --form channelId=$CHANNEL_ID \
1382 --form name="$NAME"
28c8e63e
C
1383 /videos/imports:
1384 post:
b029d58a
C
1385 summary: Import a video
1386 description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator)
28c8e63e
C
1387 security:
1388 - OAuth2: []
1389 tags:
1390 - Video
28c8e63e
C
1391 requestBody:
1392 content:
1393 multipart/form-data:
1394 schema:
1395 type: object
1396 properties:
1397 torrentfile:
1398 description: Torrent File
1399 type: string
1400 format: binary
1401 targetUrl:
1402 description: HTTP target URL
1403 type: string
1404 magnetUri:
1405 description: Magnet URI
1406 type: string
1407 channelId:
1408 description: Channel id that will contain this video
06746a8b 1409 type: integer
28c8e63e
C
1410 thumbnailfile:
1411 description: Video thumbnail file
1412 type: string
0ad45af7 1413 format: binary
28c8e63e
C
1414 previewfile:
1415 description: Video preview file
1416 type: string
0ad45af7 1417 format: binary
28c8e63e 1418 privacy:
ee89e8fd 1419 $ref: '#/components/schemas/VideoPrivacySet'
28c8e63e
C
1420 category:
1421 description: Video category
1422 type: string
1423 licence:
1424 description: Video licence
1425 type: string
1426 language:
1427 description: Video language
1428 type: string
1429 description:
1430 description: Video description
1431 type: string
1432 waitTranscoding:
1433 description: Whether or not we wait transcoding before publish the video
cd372e84 1434 type: boolean
28c8e63e 1435 support:
00494d6e
RK
1436 description: A text tell the audience how to support the video creator
1437 example: Please support my work on <insert crowdfunding plateform>! <3
28c8e63e
C
1438 type: string
1439 nsfw:
1440 description: Whether or not this video contains sensitive content
cd372e84 1441 type: boolean
28c8e63e
C
1442 name:
1443 description: Video name
1444 type: string
1445 tags:
07d02f6d 1446 description: Video tags (maximum 5 tags each between 2 and 30 characters)
28c8e63e 1447 type: array
07d02f6d
FS
1448 minItems: 1
1449 maxItems: 5
28c8e63e
C
1450 items:
1451 type: string
07d02f6d
FS
1452 minLength: 2
1453 maxLength: 30
28c8e63e
C
1454 commentsEnabled:
1455 description: Enable or disable comments for this video
cd372e84
A
1456 type: boolean
1457 downloadEnabled:
1458 description: Enable or disable downloading for this video
1459 type: boolean
5dce26d2
C
1460 scheduleUpdate:
1461 $ref: '#/components/schemas/VideoScheduledUpdate'
28c8e63e
C
1462 required:
1463 - channelId
1464 - name
0ad45af7
FS
1465 encoding:
1466 torrentfile:
1467 contentType: application/x-bittorrent
1468 thumbnailfile:
1469 contentType: image/jpeg
1470 previewfile:
1471 contentType: image/jpeg
06746a8b
RK
1472 responses:
1473 '200':
1474 description: successful operation
1475 content:
1476 application/json:
1477 schema:
1478 $ref: '#/components/schemas/VideoUploadResponse'
1479 '409':
1480 description: HTTP or Torrent/magnetURI import not enabled
1481 '400':
1482 description: '`magnetUri` or `targetUrl` or a torrent file missing'
668b7f09
C
1483
1484 /users/me/abuses:
1485 get:
1486 summary: List my abuses
1487 security:
1488 - OAuth2: []
1489 tags:
1490 - Abuses
1491 - My User
1492 parameters:
1493 - name: id
1494 in: query
1495 description: only list the report with this id
1496 schema:
1497 type: integer
1498 - name: state
1499 in: query
1500 schema:
1501 $ref: '#/components/schemas/AbuseStateSet'
1502 - $ref: '#/components/parameters/start'
1503 - $ref: '#/components/parameters/count'
1504 - $ref: '#/components/parameters/abusesSort'
1505 responses:
1506 '200':
1507 description: successful operation
1508 content:
1509 application/json:
1510 schema:
1511 type: array
1512 items:
1513 $ref: '#/components/schemas/Abuse'
1514
e3489df9 1515 /abuses:
1569a818 1516 get:
310b5219 1517 summary: List abuses
94ff4c23 1518 security:
b029d58a 1519 - OAuth2:
06746a8b
RK
1520 - admin
1521 - moderator
1569a818 1522 tags:
310b5219 1523 - Abuses
44cb3b85 1524 parameters:
84f6e32c
RK
1525 - name: id
1526 in: query
1527 description: only list the report with this id
1528 schema:
1529 type: integer
1530 - name: predefinedReason
1531 in: query
1532 description: predefined reason the listed reports should contain
1533 schema:
e3489df9 1534 $ref: '#/components/schemas/PredefinedAbuseReasons'
84f6e32c
RK
1535 - name: search
1536 in: query
1537 description: plain search that will match with video titles, reporter names and more
1538 schema:
1539 type: string
1540 - name: state
1541 in: query
84f6e32c 1542 schema:
668b7f09 1543 $ref: '#/components/schemas/AbuseStateSet'
84f6e32c
RK
1544 - name: searchReporter
1545 in: query
1546 description: only list reports of a specific reporter
1547 schema:
1548 type: string
1549 - name: searchReportee
1550 description: only list reports of a specific reportee
1551 in: query
1552 schema:
1553 type: string
1554 - name: searchVideo
1555 in: query
1556 description: only list reports of a specific video
1557 schema:
1558 type: string
1559 - name: searchVideoChannel
1560 in: query
1561 description: only list reports of a specific video channel
1562 schema:
1563 type: string
17b07dc5
C
1564 - name: videoIs
1565 in: query
1566 description: only list blacklisted or deleted videos
1567 schema:
1568 type: string
1569 enum:
1570 - 'deleted'
1571 - 'blacklisted'
1572 - name: filter
1573 in: query
1574 description: only list account, comment or video reports
1575 schema:
1576 type: string
1577 enum:
1578 - 'video'
1579 - 'comment'
1580 - 'account'
3e9e6f2f
RK
1581 - $ref: '#/components/parameters/start'
1582 - $ref: '#/components/parameters/count'
fd5af7a2 1583 - $ref: '#/components/parameters/abusesSort'
1569a818
DG
1584 responses:
1585 '200':
1586 description: successful operation
3e9e6f2f
RK
1587 content:
1588 application/json:
1589 schema:
1590 type: array
1591 items:
668b7f09 1592 $ref: '#/components/schemas/Abuse'
e3489df9 1593
1569a818 1594 post:
b029d58a 1595 summary: Report an abuse
94ff4c23 1596 security:
3e9e6f2f 1597 - OAuth2: []
1569a818 1598 tags:
310b5219 1599 - Abuses
50e16ccf 1600 requestBody:
1ebddadd 1601 required: true
50e16ccf
C
1602 content:
1603 application/json:
1604 schema:
1605 type: object
1606 properties:
1607 reason:
1608 description: Reason why the user reports this video
1609 type: string
84f6e32c 1610 minLength: 4
1ebddadd 1611 predefinedReasons:
e3489df9
C
1612 $ref: '#/components/schemas/PredefinedAbuseReasons'
1613
1614 video:
1615 type: object
1616 properties:
1617 id:
1618 description: Video id to report
1619 type: number
1620 startAt:
1621 type: integer
1622 description: Timestamp in the video that marks the beginning of the report
1623 minimum: 0
1624 endAt:
1625 type: integer
1626 description: Timestamp in the video that marks the ending of the report
1627 minimum: 0
1628 comment:
1629 type: object
1630 properties:
1631 id:
1632 description: Comment id to report
1633 type: number
1634 account:
1635 type: object
1636 properties:
1637 id:
1638 description: Account id to report
1639 type: number
1ebddadd
RK
1640 required:
1641 - reason
50e16ccf
C
1642 responses:
1643 '204':
1644 description: successful operation
84f6e32c
RK
1645 '400':
1646 description: incorrect request parameters
e3489df9 1647 '/abuses/{abuseId}':
50e16ccf
C
1648 put:
1649 summary: Update an abuse
1650 security:
1651 - OAuth2:
1652 - admin
1653 - moderator
1654 tags:
310b5219 1655 - Abuses
50e16ccf 1656 parameters:
50e16ccf
C
1657 - $ref: '#/components/parameters/abuseId'
1658 requestBody:
1659 content:
1660 application/json:
1661 schema:
1662 type: object
1663 properties:
1664 state:
4f32032f 1665 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
1666 moderationComment:
1667 type: string
84f6e32c
RK
1668 description: Update the report comment visible only to the moderation team
1669 responses:
1670 '204':
1671 description: successful operation
1672 '404':
310b5219 1673 description: abuse not found
50e16ccf 1674 delete:
84f6e32c 1675 tags:
310b5219 1676 - Abuses
50e16ccf
C
1677 summary: Delete an abuse
1678 security:
1679 - OAuth2:
1680 - admin
1681 - moderator
84f6e32c 1682 parameters:
84f6e32c 1683 - $ref: '#/components/parameters/abuseId'
50e16ccf
C
1684 responses:
1685 '204':
1686 description: successful operation
06746a8b
RK
1687 '404':
1688 description: block not found
668b7f09
C
1689 '/abuses/{abuseId}/messages':
1690 get:
1691 summary: List messages of an abuse
1692 security:
1693 - OAuth2: []
1694 tags:
1695 - Abuses
1696 parameters:
1697 - $ref: '#/components/parameters/abuseId'
1698 responses:
1699 '200':
1700 description: successful operation
1701 content:
1702 application/json:
1703 schema:
1704 type: array
1705 items:
1706 $ref: '#/components/schemas/AbuseMessage'
1707
1708 post:
1709 summary: Add message to an abuse
1710 security:
1711 - OAuth2: []
1712 tags:
1713 - Abuses
fcc4466e
C
1714 parameters:
1715 - $ref: '#/components/parameters/abuseId'
668b7f09
C
1716 requestBody:
1717 required: true
1718 content:
1719 application/json:
1720 schema:
1721 type: object
1722 properties:
1723 message:
1724 description: Message to send
1725 type: string
1726 required:
1727 - message
1728 responses:
1729 '200':
1730 description: successful operation
1731 '400':
1732 description: incorrect request parameters
1733 '/abuses/{abuseId}/messages/{abuseMessageId}':
1734 delete:
1735 summary: Delete an abuse message
1736 security:
1737 - OAuth2: []
1738 tags:
1739 - Abuses
1740 parameters:
1741 - $ref: '#/components/parameters/abuseId'
1742 - $ref: '#/components/parameters/abuseMessageId'
1743 responses:
1744 '204':
1745 description: successful operation
50e16ccf 1746
3e9e6f2f 1747 '/videos/{id}/blacklist':
1569a818 1748 post:
06746a8b 1749 summary: Block a video
94ff4c23 1750 security:
3e9e6f2f
RK
1751 - OAuth2:
1752 - admin
1753 - moderator
1569a818 1754 tags:
06746a8b 1755 - Video Blocks
1569a818 1756 parameters:
cb9d028a 1757 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1758 responses:
1759 '204':
c1843150 1760 description: successful operation
1569a818 1761 delete:
06746a8b 1762 summary: Unblock a video by its id
94ff4c23 1763 security:
3e9e6f2f
RK
1764 - OAuth2:
1765 - admin
1766 - moderator
1569a818 1767 tags:
06746a8b 1768 - Video Blocks
1569a818 1769 parameters:
cb9d028a 1770 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
1771 responses:
1772 '204':
c1843150 1773 description: successful operation
06746a8b
RK
1774 '404':
1775 description: block not found
c360c494 1776 /videos/blacklist:
1569a818 1777 get:
06746a8b
RK
1778 tags:
1779 - Video Blocks
f4d59981 1780 summary: List video blocks
94ff4c23 1781 security:
3e9e6f2f
RK
1782 - OAuth2:
1783 - admin
1784 - moderator
44cb3b85 1785 parameters:
84f6e32c
RK
1786 - name: type
1787 in: query
1788 description: >
1789 list only blocks that match this type:
1790
1791 - `1`: manual block
1792
1793 - `2`: automatic block that needs review
1794 schema:
1795 type: integer
1796 enum:
1797 - 1
1798 - 2
1799 - name: search
1800 in: query
1801 description: plain search that will match with video titles, and more
1802 schema:
1803 type: string
3e9e6f2f
RK
1804 - $ref: '#/components/parameters/start'
1805 - $ref: '#/components/parameters/count'
fd5af7a2 1806 - $ref: '#/components/parameters/blacklistsSort'
1569a818
DG
1807 responses:
1808 '200':
1809 description: successful operation
3e9e6f2f
RK
1810 content:
1811 application/json:
1812 schema:
84f6e32c
RK
1813 type: object
1814 properties:
1815 total:
1816 type: integer
1817 example: 1
1818 data:
1819 type: array
1820 items:
1821 $ref: '#/components/schemas/VideoBlacklist'
67ae04a5
C
1822 /videos/{id}/captions:
1823 get:
b029d58a 1824 summary: List captions of a video
67ae04a5 1825 tags:
04b703f6 1826 - Video Captions
67ae04a5 1827 parameters:
cb9d028a 1828 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1829 responses:
1830 '200':
1831 description: successful operation
1832 content:
1833 application/json:
1834 schema:
1835 type: object
1836 properties:
1837 total:
1838 type: integer
84f6e32c 1839 example: 1
67ae04a5
C
1840 data:
1841 type: array
1842 items:
1843 $ref: '#/components/schemas/VideoCaption'
1844 /videos/{id}/captions/{captionLanguage}:
1845 put:
1846 summary: Add or replace a video caption
1847 tags:
04b703f6 1848 - Video Captions
67ae04a5 1849 parameters:
cb9d028a 1850 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1851 - $ref: '#/components/parameters/captionLanguage'
1852 requestBody:
1853 content:
1854 multipart/form-data:
1855 schema:
1856 type: object
1857 properties:
1858 captionfile:
1859 description: The file to upload.
1860 type: string
1861 format: binary
0ad45af7
FS
1862 encoding:
1863 captionfile:
205ed5b7 1864 contentType: text/vtt, application/x-subrip, text/plain
67ae04a5
C
1865 responses:
1866 '204':
c1843150 1867 description: successful operation
06746a8b
RK
1868 '404':
1869 description: video or language not found
67ae04a5
C
1870 delete:
1871 summary: Delete a video caption
1872 tags:
04b703f6 1873 - Video Captions
67ae04a5 1874 parameters:
cb9d028a 1875 - $ref: '#/components/parameters/idOrUUID'
67ae04a5
C
1876 - $ref: '#/components/parameters/captionLanguage'
1877 responses:
1878 '204':
c1843150 1879 description: successful operation
06746a8b
RK
1880 '404':
1881 description: video or language or caption for that language not found
48dce1c9 1882 /video-channels:
1569a818 1883 get:
b029d58a 1884 summary: List video channels
1569a818 1885 tags:
b029d58a 1886 - Video Channels
44cb3b85 1887 parameters:
3e9e6f2f
RK
1888 - $ref: '#/components/parameters/start'
1889 - $ref: '#/components/parameters/count'
1890 - $ref: '#/components/parameters/sort'
1569a818
DG
1891 responses:
1892 '200':
1893 description: successful operation
3e9e6f2f
RK
1894 content:
1895 application/json:
1896 schema:
84f6e32c
RK
1897 type: object
1898 properties:
1899 total:
1900 type: integer
1901 example: 1
1902 data:
1903 type: array
1904 items:
1905 $ref: '#/components/schemas/VideoChannel'
1569a818 1906 post:
b029d58a 1907 summary: Create a video channel
94ff4c23 1908 security:
3e9e6f2f 1909 - OAuth2: []
1569a818 1910 tags:
b029d58a 1911 - Video Channels
1569a818
DG
1912 responses:
1913 '204':
c1843150 1914 description: successful operation
3e9e6f2f 1915 requestBody:
7d14d4d2
C
1916 content:
1917 application/json:
1918 schema:
1919 $ref: '#/components/schemas/VideoChannelCreate'
9ce3d302 1920 '/video-channels/{channelHandle}':
1569a818 1921 get:
b029d58a 1922 summary: Get a video channel
1569a818 1923 tags:
b029d58a 1924 - Video Channels
1569a818 1925 parameters:
9ce3d302 1926 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1927 responses:
1928 '200':
1929 description: successful operation
3e9e6f2f
RK
1930 content:
1931 application/json:
1932 schema:
1933 $ref: '#/components/schemas/VideoChannel'
1569a818 1934 put:
b029d58a 1935 summary: Update a video channel
94ff4c23 1936 security:
3e9e6f2f 1937 - OAuth2: []
1569a818 1938 tags:
b029d58a 1939 - Video Channels
1569a818 1940 parameters:
9ce3d302 1941 - $ref: '#/components/parameters/channelHandle'
1569a818
DG
1942 responses:
1943 '204':
c1843150 1944 description: successful operation
3e9e6f2f 1945 requestBody:
7d14d4d2
C
1946 content:
1947 application/json:
1948 schema:
1949 $ref: '#/components/schemas/VideoChannelUpdate'
1569a818 1950 delete:
b029d58a 1951 summary: Delete a video channel
94ff4c23 1952 security:
3e9e6f2f 1953 - OAuth2: []
1569a818 1954 tags:
b029d58a 1955 - Video Channels
1569a818 1956 parameters:
9ce3d302 1957 - $ref: '#/components/parameters/channelHandle'
cc918ac3
C
1958 responses:
1959 '204':
c1843150 1960 description: successful operation
9ce3d302 1961 '/video-channels/{channelHandle}/videos':
cc918ac3 1962 get:
b029d58a 1963 summary: List videos of a video channel
cc918ac3 1964 tags:
048b6946 1965 - Video
b029d58a 1966 - Video Channels
cc918ac3 1967 parameters:
9ce3d302 1968 - $ref: '#/components/parameters/channelHandle'
59c794a5
C
1969 - $ref: '#/components/parameters/categoryOneOf'
1970 - $ref: '#/components/parameters/tagsOneOf'
1971 - $ref: '#/components/parameters/tagsAllOf'
1972 - $ref: '#/components/parameters/licenceOneOf'
1973 - $ref: '#/components/parameters/languageOneOf'
1974 - $ref: '#/components/parameters/nsfw'
1975 - $ref: '#/components/parameters/filter'
1976 - $ref: '#/components/parameters/skipCount'
1977 - $ref: '#/components/parameters/start'
1978 - $ref: '#/components/parameters/count'
1979 - $ref: '#/components/parameters/videosSort'
1569a818 1980 responses:
cc918ac3 1981 '200':
1569a818 1982 description: successful operation
3e9e6f2f
RK
1983 content:
1984 application/json:
1985 schema:
048b6946 1986 $ref: '#/components/schemas/VideoListResponse'
c1843150
C
1987
1988 /video-playlists/privacies:
1989 get:
1990 summary: List available playlist privacies
1991 tags:
1992 - Video Playlists
1993 responses:
1994 '200':
1995 description: successful operation
1996 content:
1997 application/json:
1998 schema:
1999 type: array
2000 items:
2001 type: string
84f6e32c
RK
2002 examples:
2003 nightly:
2004 externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies
c1843150 2005
71810d0b
RK
2006 /video-playlists:
2007 get:
b029d58a 2008 summary: List video playlists
71810d0b 2009 tags:
b029d58a 2010 - Video Playlists
71810d0b
RK
2011 parameters:
2012 - $ref: '#/components/parameters/start'
2013 - $ref: '#/components/parameters/count'
2014 - $ref: '#/components/parameters/sort'
2015 responses:
2016 '200':
2017 description: successful operation
2018 content:
2019 application/json:
2020 schema:
84f6e32c
RK
2021 type: object
2022 properties:
2023 total:
2024 type: integer
2025 example: 1
2026 data:
2027 type: array
2028 items:
2029 $ref: '#/components/schemas/VideoPlaylist'
c1843150
C
2030 post:
2031 summary: Create a video playlist
2032 description: 'If the video playlist is set as public, the videoChannelId is mandatory.'
2033 security:
2034 - OAuth2: []
2035 tags:
2036 - Video Playlists
2037 responses:
2038 '200':
2039 description: successful operation
2040 content:
2041 application/json:
2042 schema:
2043 type: object
2044 properties:
2045 videoPlaylist:
2046 type: object
2047 properties:
2048 id:
06746a8b 2049 type: integer
c1843150
C
2050 uuid:
2051 type: string
2052 requestBody:
2053 content:
2054 multipart/form-data:
2055 schema:
2056 type: object
2057 properties:
2058 displayName:
2059 description: Video playlist display name
2060 type: string
2061 thumbnailfile:
2062 description: Video playlist thumbnail file
2063 type: string
2064 format: binary
2065 privacy:
2066 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2067 description:
2068 description: Video playlist description
2069 type: string
2070 videoChannelId:
2071 description: Video channel in which the playlist will be published
06746a8b 2072 type: integer
c1843150
C
2073 required:
2074 - displayName
2c318664
RK
2075 encoding:
2076 thumbnailfile:
2077 contentType: image/jpeg
c1843150
C
2078
2079 /video-playlists/{id}:
2080 get:
2081 summary: Get a video playlist
2082 tags:
2083 - Video Playlists
2084 parameters:
2085 - $ref: '#/components/parameters/idOrUUID'
2086 responses:
2087 '200':
2088 description: successful operation
2089 content:
2090 application/json:
2091 schema:
2092 $ref: '#/components/schemas/VideoPlaylist'
2093 put:
2094 summary: Update a video playlist
2095 description: 'If the video playlist is set as public, the playlist must have a assigned channel.'
2096 security:
2097 - OAuth2: []
2098 tags:
2099 - Video Playlists
2100 responses:
2101 '204':
2102 description: successful operation
2103 parameters:
2104 - $ref: '#/components/parameters/idOrUUID'
2105 requestBody:
2106 content:
2107 multipart/form-data:
2108 schema:
2109 type: object
2110 properties:
2111 displayName:
2112 description: Video playlist display name
2113 type: string
2114 thumbnailfile:
2115 description: Video playlist thumbnail file
2116 type: string
2117 format: binary
2118 privacy:
2119 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
2120 description:
2121 description: Video playlist description
2122 type: string
2123 videoChannelId:
2124 description: Video channel in which the playlist will be published
06746a8b 2125 type: integer
2c318664
RK
2126 encoding:
2127 thumbnailfile:
2128 contentType: image/jpeg
c1843150
C
2129 delete:
2130 summary: Delete a video playlist
2131 security:
2132 - OAuth2: []
2133 tags:
2134 - Video Playlists
2135 parameters:
2136 - $ref: '#/components/parameters/idOrUUID'
2137 responses:
2138 '204':
2139 description: successful operation
2140
2141 /video-playlists/{id}/videos:
2142 get:
2143 summary: 'List videos of a playlist'
2144 tags:
2145 - Videos
2146 - Video Playlists
2147 parameters:
2148 - $ref: '#/components/parameters/idOrUUID'
2149 responses:
2150 '200':
2151 description: successful operation
2152 content:
2153 application/json:
2154 schema:
2155 $ref: '#/components/schemas/VideoListResponse'
2156 post:
2157 summary: 'Add a video in a playlist'
2158 security:
2159 - OAuth2: []
2160 tags:
2161 - Videos
2162 - Video Playlists
2163 parameters:
2164 - $ref: '#/components/parameters/idOrUUID'
2165 responses:
2166 '200':
2167 description: successful operation
2168 content:
2169 application/json:
2170 schema:
2171 type: object
2172 properties:
2173 videoPlaylistElement:
2174 type: object
2175 properties:
2176 id:
06746a8b 2177 type: integer
c1843150
C
2178 requestBody:
2179 content:
2180 application/json:
2181 schema:
2182 type: object
2183 properties:
2184 videoId:
06746a8b 2185 type: integer
c1843150
C
2186 description: 'Video to add in the playlist'
2187 startTimestamp:
06746a8b 2188 type: integer
c1843150
C
2189 description: 'Start the video at this specific timestamp (in seconds)'
2190 stopTimestamp:
06746a8b 2191 type: integer
c1843150
C
2192 description: 'Stop the video at this specific timestamp (in seconds)'
2193 required:
2194 - videoId
2195
2196 /video-playlists/{id}/videos/reorder:
2197 post:
2198 summary: 'Reorder a playlist'
2199 security:
2200 - OAuth2: []
2201 tags:
2202 - Video Playlists
2203 parameters:
2204 - $ref: '#/components/parameters/idOrUUID'
2205 responses:
2206 '204':
2207 description: successful operation
2208 requestBody:
2209 content:
2210 application/json:
2211 schema:
2212 type: object
2213 properties:
2214 startPosition:
06746a8b
RK
2215 type: integer
2216 description: 'Start position of the element to reorder'
2217 minimum: 1
c1843150 2218 insertAfterPosition:
06746a8b
RK
2219 type: integer
2220 description: 'New position for the block to reorder, to add the block before the first element'
2221 minimum: 0
c1843150 2222 reorderLength:
06746a8b
RK
2223 type: integer
2224 description: 'How many element from `startPosition` to reorder'
2225 minimum: 1
c1843150
C
2226 required:
2227 - startPosition
2228 - insertAfterPosition
2229
b9e924a8 2230 /video-playlists/{id}/videos/{playlistElementId}:
c1843150
C
2231 put:
2232 summary: 'Update a playlist element'
2233 security:
2234 - OAuth2: []
2235 tags:
2236 - Video Playlists
2237 parameters:
2238 - $ref: '#/components/parameters/idOrUUID'
2239 - $ref: '#/components/parameters/playlistElementId'
2240 responses:
2241 '204':
2242 description: successful operation
2243 requestBody:
2244 content:
2245 application/json:
2246 schema:
2247 type: object
2248 properties:
2249 startTimestamp:
06746a8b 2250 type: integer
c1843150
C
2251 description: 'Start the video at this specific timestamp (in seconds)'
2252 stopTimestamp:
06746a8b 2253 type: integer
c1843150
C
2254 description: 'Stop the video at this specific timestamp (in seconds)'
2255 delete:
2256 summary: 'Delete an element from a playlist'
2257 security:
2258 - OAuth2: []
2259 tags:
2260 - Video Playlists
2261 parameters:
2262 - $ref: '#/components/parameters/idOrUUID'
2263 - $ref: '#/components/parameters/playlistElementId'
2264 responses:
2265 '204':
2266 description: successful operation
2267
0590bb46
C
2268 '/users/me/video-playlists/videos-exist':
2269 get:
2270 summary: 'Check video exists in my playlists'
2271 security:
2272 - OAuth2: []
2273 tags:
2274 - Video Playlists
2275 parameters:
2276 - name: videoIds
2277 in: query
2278 required: true
2279 description: The video ids to check
2280 schema:
2281 type: array
2282 items:
06746a8b 2283 type: integer
0590bb46
C
2284 responses:
2285 '200':
2286 description: successful operation
2287 content:
2288 application/json:
2289 schema:
2290 type: object
2291 properties:
2292 videoId:
2293 type: array
2294 items:
2295 type: object
2296 properties:
2297 playlistElementId:
06746a8b 2298 type: integer
0590bb46 2299 playlistId:
06746a8b 2300 type: integer
0590bb46 2301 startTimestamp:
06746a8b 2302 type: integer
0590bb46 2303 stopTimestamp:
06746a8b 2304 type: integer
0590bb46 2305
3e9e6f2f 2306 '/accounts/{name}/video-channels':
6b738c7a 2307 get:
b029d58a 2308 summary: List video channels of an account
6b738c7a 2309 tags:
b029d58a
C
2310 - Video Channels
2311 - Accounts
6b738c7a 2312 parameters:
3e9e6f2f 2313 - $ref: '#/components/parameters/name'
84f6e32c
RK
2314 - name: withStats
2315 in: query
2316 description: include view statistics for the last 30 days (only if authentified as the account user)
2317 schema:
2318 type: boolean
2319 - $ref: '#/components/parameters/start'
2320 - $ref: '#/components/parameters/count'
2321 - $ref: '#/components/parameters/sort'
6b738c7a
C
2322 responses:
2323 '200':
2324 description: successful operation
3e9e6f2f
RK
2325 content:
2326 application/json:
2327 schema:
2328 type: array
2329 items:
2330 $ref: '#/components/schemas/VideoChannel'
c100a614
YB
2331 '/accounts/{name}/ratings':
2332 get:
b029d58a 2333 summary: List ratings of an account
c100a614
YB
2334 security:
2335 - OAuth2: []
2336 tags:
b029d58a 2337 - Accounts
c100a614 2338 parameters:
cb9d028a 2339 - $ref: '#/components/parameters/name'
c100a614
YB
2340 - $ref: '#/components/parameters/start'
2341 - $ref: '#/components/parameters/count'
2342 - $ref: '#/components/parameters/sort'
2343 - name: rating
2344 in: query
2345 required: false
b3d1054e 2346 description: Optionally filter which ratings to retrieve
c100a614
YB
2347 schema:
2348 type: string
2349 enum:
2350 - like
2351 - dislike
2352 responses:
2353 '200':
2354 description: successful operation
2355 content:
2356 application/json:
2357 schema:
2358 type: array
2359 items:
2360 $ref: '#/components/schemas/VideoRating'
3e9e6f2f 2361 '/videos/{id}/comment-threads':
1569a818 2362 get:
b029d58a 2363 summary: List threads of a video
1569a818 2364 tags:
b029d58a 2365 - Video Comments
1569a818 2366 parameters:
cb9d028a 2367 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f
RK
2368 - $ref: '#/components/parameters/start'
2369 - $ref: '#/components/parameters/count'
71810d0b 2370 - $ref: '#/components/parameters/commentsSort'
1569a818
DG
2371 responses:
2372 '200':
2373 description: successful operation
3e9e6f2f
RK
2374 content:
2375 application/json:
2376 schema:
2377 $ref: '#/components/schemas/CommentThreadResponse'
1569a818 2378 post:
b029d58a 2379 summary: Create a thread
94ff4c23 2380 security:
3e9e6f2f 2381 - OAuth2: []
1569a818 2382 tags:
b029d58a 2383 - Video Comments
1569a818 2384 parameters:
cb9d028a 2385 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2386 responses:
2387 '200':
2388 description: successful operation
3e9e6f2f
RK
2389 content:
2390 application/json:
2391 schema:
2392 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
2393 '404':
2394 description: video does not exist
98639806
C
2395 requestBody:
2396 content:
2397 application/json:
2398 schema:
2399 type: object
2400 properties:
2401 text:
2402 type: string
2403 description: 'Text comment'
2404 required:
2405 - text
2406
3e9e6f2f 2407 '/videos/{id}/comment-threads/{threadId}':
1569a818 2408 get:
b029d58a 2409 summary: Get a thread
1569a818 2410 tags:
b029d58a 2411 - Video Comments
1569a818 2412 parameters:
cb9d028a
C
2413 - $ref: '#/components/parameters/idOrUUID'
2414 - $ref: '#/components/parameters/threadId'
1569a818
DG
2415 responses:
2416 '200':
2417 description: successful operation
3e9e6f2f
RK
2418 content:
2419 application/json:
2420 schema:
2421 $ref: '#/components/schemas/VideoCommentThreadTree'
2422 '/videos/{id}/comments/{commentId}':
1569a818 2423 post:
b029d58a 2424 summary: Reply to a thread of a video
94ff4c23 2425 security:
3e9e6f2f 2426 - OAuth2: []
1569a818 2427 tags:
b029d58a 2428 - Video Comments
1569a818 2429 parameters:
cb9d028a 2430 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 2431 - $ref: '#/components/parameters/commentId'
1569a818
DG
2432 responses:
2433 '200':
2434 description: successful operation
3e9e6f2f
RK
2435 content:
2436 application/json:
2437 schema:
2438 $ref: '#/components/schemas/CommentThreadPostResponse'
2c318664
RK
2439 '404':
2440 description: thread or video does not exist
98639806
C
2441 requestBody:
2442 content:
2443 application/json:
2444 schema:
2445 type: object
2446 properties:
2447 text:
2448 type: string
2449 description: 'Text comment'
2450 required:
2451 - text
2452
1569a818 2453 delete:
b029d58a 2454 summary: Delete a comment or a reply
94ff4c23 2455 security:
3e9e6f2f 2456 - OAuth2: []
1569a818 2457 tags:
b029d58a 2458 - Video Comments
1569a818 2459 parameters:
cb9d028a 2460 - $ref: '#/components/parameters/idOrUUID'
3e9e6f2f 2461 - $ref: '#/components/parameters/commentId'
1569a818
DG
2462 responses:
2463 '204':
c1843150 2464 description: successful operation
84f6e32c
RK
2465 '403':
2466 description: cannot remove comment of another user
2467 '404':
2468 description: comment or video does not exist
2469 '409':
2470 description: comment is already deleted
3e9e6f2f 2471 '/videos/{id}/rate':
1569a818 2472 put:
b029d58a 2473 summary: Like/dislike a video
94ff4c23 2474 security:
3e9e6f2f 2475 - OAuth2: []
1569a818 2476 tags:
b029d58a 2477 - Video Rates
1569a818 2478 parameters:
cb9d028a 2479 - $ref: '#/components/parameters/idOrUUID'
1569a818
DG
2480 responses:
2481 '204':
c1843150 2482 description: successful operation
2c318664
RK
2483 '404':
2484 description: video does not exist
fb72c193
DL
2485 /search/videos:
2486 get:
2487 tags:
2488 - Search
b029d58a 2489 summary: Search videos
fb72c193 2490 parameters:
84f6e32c
RK
2491 - name: search
2492 in: query
2493 required: true
2494 allowEmptyValue: false
2495 description: >
2496 String to search. If the user can make a remote URI search, and the string is an URI then the
2497 PeerTube instance will fetch the remote object and add it to its database. Then,
2498 you can use the REST API to fetch the complete video information and interact with it.
2499 schema:
2500 type: string
59c794a5
C
2501 - $ref: '#/components/parameters/categoryOneOf'
2502 - $ref: '#/components/parameters/tagsOneOf'
2503 - $ref: '#/components/parameters/tagsAllOf'
2504 - $ref: '#/components/parameters/licenceOneOf'
2505 - $ref: '#/components/parameters/languageOneOf'
2506 - $ref: '#/components/parameters/nsfw'
2507 - $ref: '#/components/parameters/filter'
2508 - $ref: '#/components/parameters/skipCount'
3e9e6f2f
RK
2509 - $ref: '#/components/parameters/start'
2510 - $ref: '#/components/parameters/count'
ad031145 2511 - $ref: '#/components/parameters/searchTarget'
fd5af7a2 2512 - $ref: '#/components/parameters/videosSearchSort'
ad031145
C
2513 - name: startDate
2514 in: query
ad031145
C
2515 description: Get videos that are published after this date
2516 schema:
2517 type: string
2518 format: date-time
2519 - name: endDate
2520 in: query
ad031145
C
2521 description: Get videos that are published before this date
2522 schema:
2523 type: string
2524 format: date-time
2525 - name: originallyPublishedStartDate
2526 in: query
ad031145 2527 description: Get videos that are originally published after this date
3e9e6f2f
RK
2528 schema:
2529 type: string
ad031145
C
2530 format: date-time
2531 - name: originallyPublishedEndDate
2532 in: query
ad031145
C
2533 description: Get videos that are originally published before this date
2534 schema:
2535 type: string
2536 format: date-time
2537 - name: durationMin
2538 in: query
ad031145
C
2539 description: Get videos that have this minimum duration
2540 schema:
06746a8b 2541 type: integer
ad031145
C
2542 - name: durationMax
2543 in: query
ad031145
C
2544 description: Get videos that have this maximum duration
2545 schema:
06746a8b 2546 type: integer
2c318664
RK
2547 callbacks:
2548 'searchTarget === search-index':
2549 $ref: '#/components/callbacks/searchIndex'
fb72c193
DL
2550 responses:
2551 '200':
2552 description: successful operation
3e9e6f2f
RK
2553 content:
2554 application/json:
2555 schema:
048b6946 2556 $ref: '#/components/schemas/VideoListResponse'
2c318664
RK
2557 '500':
2558 description: search index unavailable
ad031145
C
2559 /search/video-channels:
2560 get:
2561 tags:
2562 - Search
2563 summary: Search channels
2564 parameters:
ad031145
C
2565 - name: search
2566 in: query
2567 required: true
2568 description: >
2569 String to search. If the user can make a remote URI search, and the string is an URI then the
2570 PeerTube instance will fetch the remote object and add it to its database. Then,
2571 you can use the REST API to fetch the complete channel information and interact with it.
2572 schema:
2573 type: string
84f6e32c
RK
2574 - $ref: '#/components/parameters/start'
2575 - $ref: '#/components/parameters/count'
2576 - $ref: '#/components/parameters/searchTarget'
2577 - $ref: '#/components/parameters/sort'
2c318664
RK
2578 callbacks:
2579 'searchTarget === search-index':
2580 $ref: '#/components/callbacks/searchIndex'
ad031145
C
2581 responses:
2582 '200':
2583 description: successful operation
2584 content:
2585 application/json:
2586 schema:
2587 type: array
2588 items:
2589 $ref: '#/components/schemas/VideoChannel'
2c318664
RK
2590 '500':
2591 description: search index unavailable
06746a8b
RK
2592 /blocklist/accounts:
2593 get:
2594 tags:
2595 - Account Blocks
2596 summary: List account blocks
2597 security:
2598 - OAuth2:
2599 - admin
2600 parameters:
2601 - $ref: '#/components/parameters/start'
2602 - $ref: '#/components/parameters/count'
2603 - $ref: '#/components/parameters/sort'
2604 responses:
2605 '200':
2606 description: successful operation
2607 post:
2608 tags:
2609 - Account Blocks
2610 summary: Block an account
2611 security:
2612 - OAuth2:
2613 - admin
2614 requestBody:
2615 content:
2616 application/json:
2617 schema:
2618 type: object
2619 properties:
2620 accountName:
2621 type: string
84f6e32c 2622 example: chocobozzz@example.org
06746a8b
RK
2623 description: account to block, in the form `username@domain`
2624 required:
2625 - accountName
2626 responses:
2627 '200':
2628 description: successful operation
2629 '409':
2630 description: self-blocking forbidden
2631 '/blocklist/accounts/{accountName}':
2632 delete:
2633 tags:
2634 - Account Blocks
2635 summary: Unblock an account by its handle
2636 security:
2637 - OAuth2:
2638 - admin
2639 parameters:
2640 - name: accountName
2641 in: path
2642 required: true
2643 description: account to unblock, in the form `username@domain`
2644 schema:
2645 type: string
2646 responses:
2647 '201':
2648 description: successful operation
2649 '404':
2650 description: account or account block does not exist
2651 /blocklist/servers:
2652 get:
2653 tags:
2654 - Server Blocks
2655 summary: List server blocks
2656 security:
2657 - OAuth2:
2658 - admin
2659 parameters:
2660 - $ref: '#/components/parameters/start'
2661 - $ref: '#/components/parameters/count'
2662 - $ref: '#/components/parameters/sort'
2663 responses:
2664 '200':
2665 description: successful operation
2666 post:
2667 tags:
2668 - Server Blocks
2669 summary: Block a server
2670 security:
2671 - OAuth2:
2672 - admin
2673 requestBody:
2674 content:
2675 application/json:
2676 schema:
2677 type: object
2678 properties:
84f6e32c 2679 host:
06746a8b 2680 type: string
84f6e32c 2681 format: hostname
06746a8b
RK
2682 description: server domain to block
2683 required:
84f6e32c 2684 - host
06746a8b
RK
2685 responses:
2686 '200':
2687 description: successful operation
2688 '409':
2689 description: self-blocking forbidden
2690 '/blocklist/servers/{host}':
2691 delete:
2692 tags:
2693 - Server Blocks
2694 summary: Unblock a server by its domain
2695 security:
2696 - OAuth2:
2697 - admin
2698 parameters:
2699 - name: host
2700 in: path
2701 required: true
2702 description: server domain to unblock
2703 schema:
2704 type: string
84f6e32c 2705 format: hostname
06746a8b
RK
2706 responses:
2707 '201':
2708 description: successful operation
2709 '404':
2710 description: account block does not exist
04b703f6
RK
2711 /redundancy/{host}:
2712 put:
2713 tags:
2714 - Instance Redundancy
2715 summary: Update a server redundancy policy
2716 security:
2717 - OAuth2:
2718 - admin
2719 parameters:
2720 - name: host
2721 in: path
2722 required: true
2723 description: server domain to mirror
2724 schema:
2725 type: string
84f6e32c 2726 format: hostname
04b703f6
RK
2727 requestBody:
2728 content:
2729 application/json:
2730 schema:
2731 type: object
2732 properties:
2733 redundancyAllowed:
2734 type: boolean
2735 description: allow mirroring of the host's local videos
2736 required:
2737 - redundancyAllowed
2738 responses:
2739 '204':
2740 description: successful operation
2741 '404':
2742 description: server is not already known
2743 /redundancy/videos:
2744 get:
2745 tags:
2746 - Video Mirroring
2747 summary: List videos being mirrored
2748 security:
2749 - OAuth2:
2750 - admin
2751 parameters:
2752 - name: target
2753 in: query
2754 required: true
2755 description: direction of the mirror
2756 schema:
2757 type: string
2758 enum:
2759 - my-videos
2760 - remote-videos
2761 - $ref: '#/components/parameters/start'
2762 - $ref: '#/components/parameters/count'
2763 - $ref: '#/components/parameters/videoRedundanciesSort'
2764 responses:
2765 '200':
2766 description: successful operation
2767 content:
2768 application/json:
2769 schema:
2770 type: array
2771 items:
2772 $ref: '#/components/schemas/VideoRedundancy'
2773 post:
2774 tags:
2775 - Video Mirroring
2776 summary: Mirror a video
2777 security:
2778 - OAuth2:
2779 - admin
2780 requestBody:
2781 content:
2782 application/json:
2783 schema:
2784 type: object
2785 properties:
2786 videoId:
84f6e32c 2787 type: integer
04b703f6
RK
2788 required:
2789 - videoId
2790 responses:
2791 '204':
2792 description: successful operation
2793 '400':
2794 description: cannot mirror a local video
2795 '404':
2796 description: video does not exist
2797 '409':
2798 description: video is already mirrored
2799 /redundancy/videos/{redundancyId}:
2800 delete:
2801 tags:
2802 - Video Mirroring
2803 summary: Delete a mirror done on a video
2804 security:
2805 - OAuth2:
2806 - admin
2807 parameters:
2808 - name: redundancyId
2809 in: path
2810 required: true
2811 description: id of an existing redundancy on a video
2812 schema:
2813 type: string
2814 responses:
2815 '204':
2816 description: successful operation
2817 '404':
2818 description: video redundancy not found
06746a8b
RK
2819 '/feeds/video-comments.{format}':
2820 get:
2821 tags:
2822 - Feeds
2823 summary: List comments on videos
d73810be 2824 servers:
d73810be 2825 - url: 'https://peertube2.cpy.re'
f4d59981 2826 description: Live Test Server (live data - latest nightly version)
d73810be
RK
2827 - url: 'https://peertube3.cpy.re'
2828 description: Live Test Server (live data - latest RC version)
f4d59981
RK
2829 - url: 'https://peertube.cpy.re'
2830 description: Live Test Server (live data - stable version)
06746a8b
RK
2831 parameters:
2832 - name: format
2833 in: path
2834 required: true
00494d6e 2835 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
2836 schema:
2837 type: string
2838 enum:
2839 - xml
2840 - rss
2841 - rss2
2842 - atom
2843 - atom1
2844 - json
2845 - json1
2846 - name: videoId
d73810be 2847 in: query
06746a8b
RK
2848 description: 'limit listing to a specific video'
2849 schema:
2850 type: string
00494d6e
RK
2851 - name: accountId
2852 in: query
2853 description: 'limit listing to a specific account'
2854 schema:
2855 type: string
2856 - name: accountName
2857 in: query
2858 description: 'limit listing to a specific account'
2859 schema:
2860 type: string
2861 - name: videoChannelId
2862 in: query
2863 description: 'limit listing to a specific video channel'
2864 schema:
2865 type: string
2866 - name: videoChannelName
2867 in: query
2868 description: 'limit listing to a specific video channel'
2869 schema:
2870 type: string
06746a8b
RK
2871 responses:
2872 '204':
2873 description: successful operation
2874 headers:
2875 Cache-Control:
2876 schema:
2877 type: string
2878 default: 'max-age=900' # 15 min cache
2879 content:
2880 application/xml:
2881 schema:
2882 $ref: '#/components/schemas/VideoCommentsForXML'
2883 application/rss+xml:
2884 schema:
2885 $ref: '#/components/schemas/VideoCommentsForXML'
2886 text/xml:
2887 schema:
2888 $ref: '#/components/schemas/VideoCommentsForXML'
2889 application/atom+xml:
2890 schema:
2891 $ref: '#/components/schemas/VideoCommentsForXML'
2892 application/json:
2893 schema:
2894 type: object
00494d6e
RK
2895 '400':
2896 x-summary: field inconsistencies
2897 description: >
2898 Arises when:
2899 - videoId filter is mixed with a channel filter
2900 '404':
2901 description: video, video channel or account not found
06746a8b
RK
2902 '406':
2903 description: accept header unsupported
2904 '/feeds/videos.{format}':
2905 get:
2906 tags:
2907 - Feeds
2908 summary: List videos
d73810be 2909 servers:
d73810be 2910 - url: 'https://peertube2.cpy.re'
f4d59981 2911 description: Live Test Server (live data - latest nightly version)
d73810be
RK
2912 - url: 'https://peertube3.cpy.re'
2913 description: Live Test Server (live data - latest RC version)
f4d59981
RK
2914 - url: 'https://peertube.cpy.re'
2915 description: Live Test Server (live data - stable version)
06746a8b
RK
2916 parameters:
2917 - name: format
2918 in: path
2919 required: true
00494d6e 2920 description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))'
06746a8b
RK
2921 schema:
2922 type: string
2923 enum:
2924 - xml
2925 - rss
2926 - rss2
2927 - atom
2928 - atom1
2929 - json
2930 - json1
2931 - name: accountId
d73810be 2932 in: query
06746a8b
RK
2933 description: 'limit listing to a specific account'
2934 schema:
2935 type: string
2936 - name: accountName
d73810be 2937 in: query
06746a8b
RK
2938 description: 'limit listing to a specific account'
2939 schema:
2940 type: string
2941 - name: videoChannelId
d73810be 2942 in: query
06746a8b
RK
2943 description: 'limit listing to a specific video channel'
2944 schema:
2945 type: string
2946 - name: videoChannelName
d73810be 2947 in: query
06746a8b
RK
2948 description: 'limit listing to a specific video channel'
2949 schema:
2950 type: string
84f6e32c
RK
2951 - $ref: '#/components/parameters/sort'
2952 - $ref: '#/components/parameters/nsfw'
2953 - $ref: '#/components/parameters/filter'
06746a8b
RK
2954 responses:
2955 '204':
2956 description: successful operation
2957 headers:
2958 Cache-Control:
2959 schema:
2960 type: string
2961 default: 'max-age=900' # 15 min cache
2962 content:
2963 application/xml:
2964 schema:
2965 $ref: '#/components/schemas/VideosForXML'
84f6e32c
RK
2966 examples:
2967 nightly:
2968 externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local
06746a8b
RK
2969 application/rss+xml:
2970 schema:
2971 $ref: '#/components/schemas/VideosForXML'
2972 text/xml:
2973 schema:
2974 $ref: '#/components/schemas/VideosForXML'
2975 application/atom+xml:
2976 schema:
2977 $ref: '#/components/schemas/VideosForXML'
2978 application/json:
2979 schema:
2980 type: object
00494d6e
RK
2981 '404':
2982 description: video channel or account not found
06746a8b
RK
2983 '406':
2984 description: accept header unsupported
7461d440
RK
2985 /plugins:
2986 get:
2987 tags:
2988 - Plugins
2989 summary: List plugins
2990 security:
2991 - OAuth2:
2992 - admin
2993 parameters:
2994 - name: pluginType
2995 in: query
2996 schema:
2997 type: integer
2998 - name: uninstalled
2999 in: query
3000 schema:
3001 type: boolean
3002 - $ref: '#/components/parameters/start'
3003 - $ref: '#/components/parameters/count'
3004 - $ref: '#/components/parameters/sort'
3005 responses:
3006 '200':
3007 description: successful operation
3008 content:
3009 application/json:
3010 schema:
3011 $ref: '#/components/schemas/PluginResponse'
3012 /plugins/available:
3013 get:
3014 tags:
3015 - Plugins
3016 summary: List available plugins
3017 security:
3018 - OAuth2:
3019 - admin
3020 parameters:
3021 - name: search
3022 in: query
3023 schema:
3024 type: string
3025 - name: pluginType
3026 in: query
3027 schema:
3028 type: integer
3029 - name: currentPeerTubeEngine
3030 in: query
3031 schema:
3032 type: string
3033 - $ref: '#/components/parameters/start'
3034 - $ref: '#/components/parameters/count'
3035 - $ref: '#/components/parameters/sort'
3036 responses:
3037 '200':
3038 description: successful operation
3039 content:
3040 application/json:
3041 schema:
3042 $ref: '#/components/schemas/PluginResponse'
3043 '503':
3044 description: plugin index unavailable
3045 /plugins/install:
3046 post:
3047 tags:
3048 - Plugins
3049 summary: Install a plugin
3050 security:
3051 - OAuth2:
3052 - admin
3053 requestBody:
3054 content:
3055 application/json:
3056 schema:
3057 oneOf:
3058 - type: object
3059 properties:
3060 npmName:
3061 type: string
84f6e32c 3062 example: peertube-plugin-auth-ldap
7461d440
RK
3063 required:
3064 - npmName
3065 additionalProperties: false
3066 - type: object
3067 properties:
3068 path:
3069 type: string
3070 required:
3071 - path
3072 additionalProperties: false
3073 responses:
3074 '204':
3075 description: successful operation
3076 '400':
3077 description: should have either `npmName` or `path` set
3078 /plugins/update:
3079 post:
3080 tags:
3081 - Plugins
3082 summary: Update a plugin
3083 security:
3084 - OAuth2:
3085 - admin
3086 requestBody:
3087 content:
3088 application/json:
3089 schema:
3090 oneOf:
3091 - type: object
3092 properties:
3093 npmName:
3094 type: string
84f6e32c 3095 example: peertube-plugin-auth-ldap
7461d440
RK
3096 required:
3097 - npmName
3098 additionalProperties: false
3099 - type: object
3100 properties:
3101 path:
3102 type: string
3103 required:
3104 - path
3105 additionalProperties: false
3106 responses:
3107 '204':
3108 description: successful operation
3109 '400':
3110 description: should have either `npmName` or `path` set
3111 '404':
3112 description: existing plugin not found
3113 /plugins/uninstall:
3114 post:
3115 tags:
3116 - Plugins
3117 summary: Uninstall a plugin
3118 security:
3119 - OAuth2:
3120 - admin
3121 requestBody:
3122 content:
3123 application/json:
3124 schema:
3125 type: object
3126 properties:
3127 npmName:
3128 type: string
84f6e32c
RK
3129 description: name of the plugin/theme in its package.json
3130 example: peertube-plugin-auth-ldap
7461d440
RK
3131 required:
3132 - npmName
3133 responses:
3134 '204':
3135 description: successful operation
3136 '404':
3137 description: existing plugin not found
3138 /plugins/{npmName}:
3139 get:
3140 tags:
3141 - Plugins
3142 summary: Get a plugin
3143 security:
3144 - OAuth2:
3145 - admin
3146 parameters:
84f6e32c 3147 - $ref: '#/components/parameters/npmName'
7461d440
RK
3148 responses:
3149 '200':
3150 description: successful operation
3151 content:
3152 application/json:
3153 schema:
3154 $ref: '#/components/schemas/Plugin'
3155 '404':
3156 description: plugin not found
3157 /plugins/{npmName}/settings:
3158 put:
3159 tags:
3160 - Plugins
3161 summary: Set a plugin's settings
3162 security:
3163 - OAuth2:
3164 - admin
3165 parameters:
84f6e32c 3166 - $ref: '#/components/parameters/npmName'
7461d440
RK
3167 requestBody:
3168 content:
3169 application/json:
3170 schema:
3171 type: object
3172 properties:
3173 settings:
3174 type: object
3175 additionalProperties: true
3176 responses:
3177 '204':
3178 description: successful operation
3179 '404':
3180 description: plugin not found
3181 /plugins/{npmName}/public-settings:
3182 get:
3183 tags:
3184 - Plugins
3185 summary: Get a plugin's public settings
7461d440 3186 parameters:
84f6e32c 3187 - $ref: '#/components/parameters/npmName'
7461d440
RK
3188 responses:
3189 '200':
3190 description: successful operation
3191 content:
3192 application/json:
3193 schema:
3194 type: object
3195 additionalProperties: true
3196 '404':
3197 description: plugin not found
3198 /plugins/{npmName}/registered-settings:
3199 get:
3200 tags:
3201 - Plugins
3202 summary: Get a plugin's registered settings
3203 security:
3204 - OAuth2:
3205 - admin
3206 parameters:
84f6e32c 3207 - $ref: '#/components/parameters/npmName'
7461d440
RK
3208 responses:
3209 '200':
3210 description: successful operation
3211 content:
3212 application/json:
3213 schema:
3214 type: object
3215 additionalProperties: true
3216 '404':
3217 description: plugin not found
3e9e6f2f 3218servers:
8f9e8be1 3219 - url: 'https://peertube2.cpy.re/api/v1'
f4d59981 3220 description: Live Test Server (live data - latest nightly version)
6441981b 3221 - url: 'https://peertube3.cpy.re/api/v1'
b029d58a 3222 description: Live Test Server (live data - latest RC version)
f4d59981
RK
3223 - url: 'https://peertube.cpy.re/api/v1'
3224 description: Live Test Server (live data - stable version)
3e9e6f2f
RK
3225components:
3226 parameters:
3227 start:
3228 name: start
3229 in: query
3230 required: false
06746a8b 3231 description: Offset used to paginate results
3e9e6f2f 3232 schema:
06746a8b 3233 type: integer
84f6e32c 3234 minimum: 0
3e9e6f2f
RK
3235 count:
3236 name: count
3237 in: query
3238 required: false
06746a8b 3239 description: "Number of items to return"
3e9e6f2f 3240 schema:
06746a8b 3241 type: integer
84f6e32c 3242 default: 15
06746a8b
RK
3243 maximum: 100
3244 minimum: 1
3e9e6f2f
RK
3245 sort:
3246 name: sort
3247 in: query
3248 required: false
84f6e32c 3249 description: Sort column
3e9e6f2f
RK
3250 schema:
3251 type: string
84f6e32c 3252 example: -createdAt
8491293b
RK
3253 search:
3254 name: search
3255 in: query
3256 required: false
3257 description: Plain text search, applied to various parts of the model depending on endpoint
3258 schema:
3259 type: string
ad031145
C
3260 searchTarget:
3261 name: searchTarget
3262 in: query
3263 required: false
3264 description: >
3265 If the administrator enabled search index support, you can override the default search target.
3266
3267
3268 **Warning**: If you choose to make an index search, PeerTube will get results from a third party service.
84f6e32c 3269 It means the instance may not yet know the objects you fetched. If you want to load video/channel information:
ad031145
C
3270 * If the current user has the ability to make a remote URI search (this information is available in the config endpoint),
3271 then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database.
3272 After that, you can use the classic REST API endpoints to fetch the complete object or interact with it
84f6e32c 3273 * 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
3274 the data from the origin instance API
3275 schema:
3276 type: string
3277 enum:
3278 - 'local'
3279 - 'search-index'
fd5af7a2
RK
3280 videosSort:
3281 name: sort
3282 in: query
3283 required: false
3284 description: Sort videos by criteria
3285 schema:
3286 type: string
3287 enum:
04b703f6 3288 - name
fd5af7a2
RK
3289 - -duration
3290 - -createdAt
3291 - -publishedAt
3292 - -views
3293 - -likes
3294 - -trending
3295 videosSearchSort:
3296 name: sort
3297 in: query
3298 required: false
3299 description: Sort videos by criteria
3300 schema:
3301 type: string
3302 enum:
04b703f6 3303 - name
fd5af7a2
RK
3304 - -duration
3305 - -createdAt
3306 - -publishedAt
3307 - -views
3308 - -likes
3309 - -match
71810d0b
RK
3310 commentsSort:
3311 name: sort
3312 in: query
3313 required: false
3314 description: Sort comments by criteria
3315 schema:
3316 type: string
3317 enum:
3318 - -createdAt
3319 - -totalReplies
fd5af7a2
RK
3320 blacklistsSort:
3321 name: sort
3322 in: query
3323 required: false
3324 description: Sort blacklists by criteria
3325 schema:
3326 type: string
3327 enum:
3328 - -id
04b703f6 3329 - name
fd5af7a2
RK
3330 - -duration
3331 - -views
3332 - -likes
3333 - -dislikes
3334 - -uuid
3335 - -createdAt
8491293b
RK
3336 usersSearch:
3337 name: search
3338 in: query
3339 required: false
3340 description: Plain text search that will match with user usernames or emails
3341 schema:
3342 type: string
3343 usersBlocked:
3344 name: blocked
3345 in: query
3346 required: false
3347 description: Filter results down to (un)banned users
3348 schema:
3349 type: boolean
fd5af7a2
RK
3350 usersSort:
3351 name: sort
3352 in: query
3353 required: false
3354 description: Sort users by criteria
3355 schema:
3356 type: string
3357 enum:
3358 - -id
3359 - -username
3360 - -createdAt
3361 abusesSort:
3362 name: sort
3363 in: query
3364 required: false
3365 description: Sort abuses by criteria
3366 schema:
3367 type: string
3368 enum:
3369 - -id
3370 - -createdAt
3371 - -state
04b703f6
RK
3372 videoRedundanciesSort:
3373 name: sort
3374 in: query
3375 required: false
3376 description: Sort abuses by criteria
3377 schema:
3378 type: string
3379 enum:
3380 - name
3e9e6f2f
RK
3381 name:
3382 name: name
3383 in: path
3384 required: true
84f6e32c 3385 description: The name of the account
3e9e6f2f
RK
3386 schema:
3387 type: string
84f6e32c 3388 example: chocobozzz | chocobozzz@example.org
3e9e6f2f
RK
3389 id:
3390 name: id
3391 in: path
3392 required: true
3393 description: The user id
3394 schema:
06746a8b 3395 type: integer
84f6e32c
RK
3396 minimum: 0
3397 example: 42
cb9d028a 3398 idOrUUID:
3e9e6f2f
RK
3399 name: id
3400 in: path
3401 required: true
c1843150 3402 description: The object id or uuid
3e9e6f2f 3403 schema:
84f6e32c
RK
3404 oneOf:
3405 - type: integer
3406 minimum: 0
3407 example: 42
3408 - type: string
3409 format: uuid
3410 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
c1843150
C
3411 playlistElementId:
3412 name: playlistElementId
3413 in: path
3414 required: true
3415 description: Playlist element id
3416 schema:
06746a8b 3417 type: integer
50e16ccf
C
3418 abuseId:
3419 name: abuseId
3420 in: path
3421 required: true
310b5219 3422 description: Abuse id
50e16ccf 3423 schema:
06746a8b 3424 type: integer
668b7f09
C
3425 abuseMessageId:
3426 name: abuseMessageId
3427 in: path
3428 required: true
3429 description: Abuse message id
3430 schema:
3431 type: integer
67ae04a5
C
3432 captionLanguage:
3433 name: captionLanguage
3434 in: path
3435 required: true
3436 description: The caption language
3437 schema:
3438 type: string
9ce3d302
C
3439 channelHandle:
3440 name: channelHandle
3e9e6f2f
RK
3441 in: path
3442 required: true
84f6e32c 3443 description: The video channel handle
3e9e6f2f
RK
3444 schema:
3445 type: string
84f6e32c 3446 example: my_username | my_username@example.com
cb9d028a
C
3447 subscriptionHandle:
3448 name: subscriptionHandle
3449 in: path
3450 required: true
84f6e32c 3451 description: The subscription handle
cb9d028a
C
3452 schema:
3453 type: string
84f6e32c 3454 example: my_username | my_username@example.com
cb9d028a 3455 threadId:
3e9e6f2f
RK
3456 name: threadId
3457 in: path
3458 required: true
cb9d028a
C
3459 description: The thread id (root comment id)
3460 schema:
06746a8b 3461 type: integer
cb9d028a
C
3462 commentId:
3463 name: commentId
3464 in: path
3465 required: true
3e9e6f2f
RK
3466 description: The comment id
3467 schema:
06746a8b 3468 type: integer
fd5af7a2
RK
3469 categoryOneOf:
3470 name: categoryOneOf
3471 in: query
3472 required: false
84f6e32c 3473 description: category id of the video (see [/videos/categories](#tag/Video/paths/~1videos~1categories/get))
fd5af7a2
RK
3474 schema:
3475 oneOf:
06746a8b 3476 - type: integer
fd5af7a2
RK
3477 - type: array
3478 items:
06746a8b 3479 type: integer
2beb9895
RK
3480 style: form
3481 explode: false
fd5af7a2
RK
3482 tagsOneOf:
3483 name: tagsOneOf
3484 in: query
3485 required: false
3486 description: tag(s) of the video
3487 schema:
3488 oneOf:
3489 - type: string
3490 - type: array
3491 items:
3492 type: string
2beb9895
RK
3493 style: form
3494 explode: false
fd5af7a2
RK
3495 tagsAllOf:
3496 name: tagsAllOf
3497 in: query
3498 required: false
3499 description: tag(s) of the video, where all should be present in the video
3500 schema:
3501 oneOf:
3502 - type: string
3503 - type: array
3504 items:
3505 type: string
2beb9895
RK
3506 style: form
3507 explode: false
fd5af7a2
RK
3508 languageOneOf:
3509 name: languageOneOf
3510 in: query
3511 required: false
84f6e32c 3512 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
3513 schema:
3514 oneOf:
2beb9895 3515 - type: string
fd5af7a2
RK
3516 - type: array
3517 items:
2beb9895
RK
3518 type: string
3519 style: form
3520 explode: false
fd5af7a2
RK
3521 licenceOneOf:
3522 name: licenceOneOf
3523 in: query
3524 required: false
84f6e32c 3525 description: licence id of the video (see [/videos/licences](#tag/Video/paths/~1videos~1licences/get))
fd5af7a2
RK
3526 schema:
3527 oneOf:
06746a8b 3528 - type: integer
fd5af7a2
RK
3529 - type: array
3530 items:
06746a8b 3531 type: integer
2beb9895
RK
3532 style: form
3533 explode: false
59c794a5
C
3534 skipCount:
3535 name: skipCount
3536 in: query
3537 required: false
3538 description: if you don't need the `total` in the response
3539 schema:
3540 type: string
3541 enum:
3542 - 'true'
3543 - 'false'
06746a8b 3544 default: 'false'
fd5af7a2
RK
3545 nsfw:
3546 name: nsfw
3547 in: query
3548 required: false
3549 description: whether to include nsfw videos, if any
3550 schema:
3551 type: string
3552 enum:
3553 - 'true'
3554 - 'false'
3555 filter:
3556 name: filter
3557 in: query
3558 required: false
3559 description: >
3560 Special filters (local for instance) which might require special rights:
3561 * `local` - only videos local to the instance
3562 * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges)
3563 schema:
3564 type: string
3565 enum:
3566 - local
3567 - all-local
e76d5784
RK
3568 subscriptionsUris:
3569 name: uris
3570 in: query
3571 required: true
3572 description: list of uris to check if each is part of the user subscriptions
3573 schema:
3574 type: array
3575 items:
3576 type: string
84f6e32c
RK
3577 format: uri
3578 npmName:
3579 name: npmName
3580 in: path
3581 required: true
3582 description: name of the plugin/theme on npmjs.com or in its package.json
3583 schema:
3584 type: string
3585 example: peertube-plugin-auth-ldap
3e9e6f2f
RK
3586 securitySchemes:
3587 OAuth2:
3588 description: >
3589 In the header: *Authorization: Bearer <token\>*
3590
3591
3592 Authenticating via OAuth requires the following steps:
3593
3594
3595 - Have an account with sufficient authorization levels
3596
46e9407c 3597 - [Generate](https://docs.joinpeertube.org/#/api-rest-getting-started) a
3e9e6f2f
RK
3598 Bearer Token
3599
3600 - Make Authenticated Requests
3601 type: oauth2
3602 flows:
3603 password:
3604 tokenUrl: 'https://peertube.example.com/api/v1/users/token'
3605 scopes:
3606 admin: Admin scope
3607 moderator: Moderator scope
3608 user: User scope
3609 schemas:
3610 VideoConstantNumber:
3611 properties:
3612 id:
06746a8b 3613 type: integer
3e9e6f2f
RK
3614 label:
3615 type: string
3616 VideoConstantString:
3617 properties:
3618 id:
3619 type: string
3620 label:
3621 type: string
c1843150
C
3622
3623 VideoPlaylistPrivacySet:
3624 type: integer
3625 enum:
3626 - 1
3627 - 2
3628 - 3
06746a8b 3629 description: 'The video playlist privacy (Public = `1`, Unlisted = `2`, Private = `3`)'
c1843150
C
3630 VideoPlaylistPrivacyConstant:
3631 properties:
3632 id:
3633 $ref: '#/components/schemas/VideoPlaylistPrivacySet'
3634 label:
3635 type: string
3636
3637 VideoPlaylistTypeSet:
3638 type: integer
3639 enum:
3640 - 1
3641 - 2
06746a8b 3642 description: 'The video playlist type (Regular = `1`, Watch Later = `2`)'
c1843150
C
3643 VideoPlaylistTypeConstant:
3644 properties:
3645 id:
3646 $ref: '#/components/schemas/VideoPlaylistTypeSet'
3647 label:
3648 type: string
3649
ee89e8fd
C
3650 VideoPrivacySet:
3651 type: integer
3e9e6f2f 3652 enum:
ee89e8fd
C
3653 - 1
3654 - 2
3655 - 3
c1843150 3656 - 4
06746a8b 3657 description: 'The video privacy (Public = `1`, Unlisted = `2`, Private = `3`, Internal = `4`)'
ee89e8fd
C
3658 VideoPrivacyConstant:
3659 properties:
3660 id:
c1843150 3661 $ref: '#/components/schemas/VideoPrivacySet'
ee89e8fd
C
3662 label:
3663 type: string
50e16ccf 3664
0590bb46
C
3665 NSFWPolicy:
3666 type: string
3667 enum:
3668 - display
3669 - blur
3670 - do_not_list
3671
3672 UserRole:
06746a8b 3673 type: integer
0590bb46
C
3674 enum:
3675 - 0
3676 - 1
3677 - 2
06746a8b 3678 description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)'
2c318664 3679 example: 2
0590bb46 3680
5dce26d2
C
3681 VideoStateConstant:
3682 properties:
3683 id:
3684 type: integer
3685 enum:
3686 - 1
3687 - 2
3688 - 3
06746a8b 3689 description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)'
5dce26d2
C
3690 label:
3691 type: string
50e16ccf 3692
4f32032f 3693 AbuseStateSet:
50e16ccf
C
3694 type: integer
3695 enum:
3696 - 1
3697 - 2
3698 - 3
668b7f09 3699 description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)'
4f32032f 3700 AbuseStateConstant:
50e16ccf
C
3701 properties:
3702 id:
4f32032f 3703 $ref: '#/components/schemas/AbuseStateSet'
50e16ccf
C
3704 label:
3705 type: string
4f32032f 3706 AbusePredefinedReasons:
1ebddadd
RK
3707 type: array
3708 items:
3709 type: string
3710 enum:
3711 - violentOrAbusive
3712 - hatefulOrAbusive
3713 - spamOrMisleading
3714 - privacy
3715 - rights
3716 - serverRules
3717 - thumbnails
3718 - captions
84f6e32c 3719 example: [spamOrMisleading]
50e16ccf 3720
5dce26d2
C
3721 VideoResolutionConstant:
3722 properties:
3723 id:
3724 type: integer
3725 description: 'Video resolution (240, 360, 720 ...)'
84f6e32c 3726 example: 240
5dce26d2
C
3727 label:
3728 type: string
84f6e32c 3729 example: 240p
5dce26d2
C
3730 VideoScheduledUpdate:
3731 properties:
3732 privacy:
3733 $ref: '#/components/schemas/VideoPrivacySet'
5dce26d2
C
3734 updateAt:
3735 type: string
3736 format: date
3737 description: When to update the video
3738 required:
3739 - updateAt
c1843150 3740 AccountSummary:
5dce26d2
C
3741 properties:
3742 id:
06746a8b 3743 type: integer
5dce26d2
C
3744 name:
3745 type: string
3746 displayName:
3747 type: string
3748 url:
3749 type: string
84f6e32c 3750 format: url
5dce26d2
C
3751 host:
3752 type: string
84f6e32c 3753 format: hostname
5dce26d2
C
3754 avatar:
3755 nullable: true
c1843150
C
3756 allOf:
3757 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
3758 VideoChannelSummary:
3759 properties:
3760 id:
06746a8b 3761 type: integer
5dce26d2
C
3762 name:
3763 type: string
3764 displayName:
3765 type: string
3766 url:
3767 type: string
84f6e32c 3768 format: url
5dce26d2
C
3769 host:
3770 type: string
84f6e32c 3771 format: hostname
5dce26d2
C
3772 avatar:
3773 nullable: true
c1843150
C
3774 allOf:
3775 - $ref: '#/components/schemas/Avatar'
5dce26d2
C
3776 PlaylistElement:
3777 properties:
3778 position:
06746a8b 3779 type: integer
5dce26d2 3780 startTimestamp:
06746a8b 3781 type: integer
5dce26d2 3782 stopTimestamp:
06746a8b 3783 type: integer
bfbd9128
C
3784 video:
3785 nullable: true
c1843150
C
3786 allOf:
3787 - $ref: '#/components/schemas/Video'
5dce26d2
C
3788 VideoFile:
3789 properties:
3790 magnetUri:
3791 type: string
3792 resolution:
3793 $ref: '#/components/schemas/VideoResolutionConstant'
3794 size:
06746a8b 3795 type: integer
5dce26d2
C
3796 description: 'Video file size in bytes'
3797 torrentUrl:
3798 type: string
84f6e32c 3799 format: url
0ad45af7 3800 torrentDownloadUrl:
5dce26d2 3801 type: string
84f6e32c 3802 format: url
5dce26d2
C
3803 fileUrl:
3804 type: string
84f6e32c 3805 format: url
5dce26d2
C
3806 fileDownloadUrl:
3807 type: string
84f6e32c 3808 format: url
5dce26d2
C
3809 fps:
3810 type: number
63748ad0
C
3811 metadataUrl:
3812 type: string
84f6e32c 3813 format: url
5dce26d2
C
3814 VideoStreamingPlaylists:
3815 properties:
3816 id:
06746a8b 3817 type: integer
5dce26d2 3818 type:
06746a8b 3819 type: integer
5dce26d2
C
3820 enum:
3821 - 1
06746a8b 3822 description: 'Playlist type (HLS = `1`)'
5dce26d2
C
3823 playlistUrl:
3824 type: string
84f6e32c 3825 format: url
5dce26d2
C
3826 segmentsSha256Url:
3827 type: string
84f6e32c 3828 format: url
63748ad0
C
3829 files:
3830 type: array
000ca2a8 3831 description: 'Video files associated to this playlist. The difference with the root "files" property is that these files are fragmented, so they can be used in this streaming playlist (HLS etc)'
63748ad0
C
3832 items:
3833 $ref: '#/components/schemas/VideoFile'
5dce26d2
C
3834 redundancies:
3835 type: array
3836 items:
3837 type: object
3838 properties:
3839 baseUrl:
3840 type: string
84f6e32c 3841 format: url
f4d59981
RK
3842 VideoInfo:
3843 properties:
3844 id:
3845 type: integer
3846 uuid:
3847 type: string
84f6e32c
RK
3848 format: uuid
3849 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
f4d59981
RK
3850 name:
3851 type: string
3e9e6f2f
RK
3852 Video:
3853 properties:
3854 id:
06746a8b 3855 type: integer
84f6e32c 3856 example: 8
3e9e6f2f
RK
3857 uuid:
3858 type: string
84f6e32c
RK
3859 format: uuid
3860 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
3861 createdAt:
3862 type: string
84f6e32c 3863 format: date-time
3e9e6f2f
RK
3864 publishedAt:
3865 type: string
84f6e32c 3866 format: date-time
3e9e6f2f
RK
3867 updatedAt:
3868 type: string
84f6e32c 3869 format: date-time
5dce26d2
C
3870 originallyPublishedAt:
3871 type: string
84f6e32c 3872 format: date-time
3e9e6f2f
RK
3873 category:
3874 $ref: '#/components/schemas/VideoConstantNumber'
3875 licence:
3876 $ref: '#/components/schemas/VideoConstantNumber'
3877 language:
3878 $ref: '#/components/schemas/VideoConstantString'
3879 privacy:
ee89e8fd 3880 $ref: '#/components/schemas/VideoPrivacyConstant'
3e9e6f2f
RK
3881 description:
3882 type: string
3883 duration:
06746a8b 3884 type: integer
84f6e32c 3885 example: 1419
3e9e6f2f
RK
3886 isLocal:
3887 type: boolean
3888 name:
3889 type: string
84f6e32c 3890 example: What is PeerTube?
3e9e6f2f
RK
3891 thumbnailPath:
3892 type: string
84f6e32c 3893 example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
3894 previewPath:
3895 type: string
20dcfd74 3896 example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg
3e9e6f2f
RK
3897 embedPath:
3898 type: string
84f6e32c 3899 example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee
3e9e6f2f 3900 views:
06746a8b 3901 type: integer
84f6e32c 3902 example: 1337
3e9e6f2f 3903 likes:
06746a8b 3904 type: integer
84f6e32c 3905 example: 42
3e9e6f2f 3906 dislikes:
06746a8b 3907 type: integer
84f6e32c 3908 example: 7
3e9e6f2f
RK
3909 nsfw:
3910 type: boolean
5dce26d2
C
3911 waitTranscoding:
3912 type: boolean
3913 nullable: true
3914 state:
3915 $ref: '#/components/schemas/VideoStateConstant'
3916 scheduledUpdate:
3917 nullable: true
c1843150
C
3918 allOf:
3919 - $ref: '#/components/schemas/VideoScheduledUpdate'
5dce26d2
C
3920 blacklisted:
3921 nullable: true
3922 type: boolean
3923 blacklistedReason:
3924 nullable: true
3925 type: string
3e9e6f2f 3926 account:
c1843150 3927 $ref: '#/components/schemas/AccountSummary'
5dce26d2
C
3928 channel:
3929 $ref: '#/components/schemas/VideoChannelSummary'
3930 userHistory:
3931 nullable: true
3e9e6f2f
RK
3932 type: object
3933 properties:
5dce26d2 3934 currentTime:
06746a8b 3935 type: integer
5dce26d2
C
3936 VideoDetails:
3937 allOf:
3938 - $ref: '#/components/schemas/Video'
3939 - type: object
3940 properties:
3941 descriptionPath:
3e9e6f2f 3942 type: string
5dce26d2 3943 support:
3e9e6f2f 3944 type: string
00494d6e 3945 description: A text tell the audience how to support the video creator
84f6e32c 3946 example: Please support my work on <insert crowdfunding plateform>! <3
5dce26d2
C
3947 channel:
3948 $ref: '#/components/schemas/VideoChannel'
3949 account:
3950 $ref: '#/components/schemas/Account'
3951 tags:
3952 type: array
3953 items:
3954 type: string
84f6e32c 3955 example: [flowers, gardening]
5dce26d2
C
3956 files:
3957 type: array
000ca2a8 3958 description: 'WebTorrent/raw video files. Can be empty if WebTorrent is disabled on the server. In this case, video files will be in the "streamingPlaylists[].files" property'
5dce26d2
C
3959 items:
3960 $ref: '#/components/schemas/VideoFile'
3961 commentsEnabled:
3962 type: boolean
3963 downloadEnabled:
3964 type: boolean
3965 trackerUrls:
3966 type: array
3967 items:
3968 type: string
84f6e32c 3969 format: url
5dce26d2
C
3970 streamingPlaylists:
3971 type: array
3972 items:
3973 $ref: '#/components/schemas/VideoStreamingPlaylists'
04b703f6
RK
3974 FileRedundancyInformation:
3975 properties:
3976 id:
3977 type: integer
3978 fileUrl:
3979 type: string
84f6e32c 3980 format: url
04b703f6
RK
3981 strategy:
3982 type: string
84f6e32c
RK
3983 enum:
3984 - manual
3985 - most-views
3986 - trending
3987 - recently-added
04b703f6
RK
3988 size:
3989 type: integer
3990 createdAt:
3991 type: string
3992 format: date-time
3993 updatedAt:
3994 type: string
3995 format: date-time
3996 expiresOn:
3997 type: string
3998 format: date-time
3999 VideoRedundancy:
4000 properties:
4001 id:
4002 type: integer
4003 name:
4004 type: string
4005 url:
4006 type: string
84f6e32c 4007 format: url
04b703f6
RK
4008 uuid:
4009 type: string
84f6e32c
RK
4010 format: uuid
4011 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
04b703f6
RK
4012 redundancies:
4013 type: object
4014 properties:
4015 files:
4016 type: array
4017 items:
1e904cde 4018 $ref: '#/components/schemas/FileRedundancyInformation'
04b703f6
RK
4019 streamingPlaylists:
4020 type: array
4021 items:
1e904cde 4022 $ref: '#/components/schemas/FileRedundancyInformation'
1f82e3e8
C
4023 VideoImportStateConstant:
4024 properties:
4025 id:
4026 type: integer
4027 enum:
4028 - 1
4029 - 2
4030 - 3
06746a8b 4031 description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)'
1f82e3e8
C
4032 label:
4033 type: string
84f6e32c 4034 example: Pending
1f82e3e8
C
4035 VideoImport:
4036 properties:
4037 id:
06746a8b 4038 type: integer
84f6e32c 4039 example: 2
1f82e3e8
C
4040 targetUrl:
4041 type: string
84f6e32c
RK
4042 format: url
4043 example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d
1f82e3e8
C
4044 magnetUri:
4045 type: string
84f6e32c
RK
4046 format: uri
4047 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
4048 torrentName:
4049 type: string
4050 state:
84f6e32c 4051 $ref: '#/components/schemas/VideoImportStateConstant'
1f82e3e8
C
4052 error:
4053 type: string
4054 createdAt:
4055 type: string
84f6e32c 4056 format: date-time
1f82e3e8
C
4057 updatedAt:
4058 type: string
84f6e32c 4059 format: date-time
1f82e3e8
C
4060 video:
4061 $ref: '#/components/schemas/Video'
668b7f09 4062 Abuse:
3e9e6f2f
RK
4063 properties:
4064 id:
06746a8b 4065 type: integer
84f6e32c 4066 example: 7
3e9e6f2f
RK
4067 reason:
4068 type: string
84f6e32c 4069 example: The video is a spam
1ebddadd 4070 predefinedReasons:
4f32032f 4071 $ref: '#/components/schemas/AbusePredefinedReasons'
3e9e6f2f
RK
4072 reporterAccount:
4073 $ref: '#/components/schemas/Account'
50e16ccf 4074 state:
4f32032f 4075 $ref: '#/components/schemas/AbuseStateConstant'
50e16ccf
C
4076 moderationComment:
4077 type: string
84f6e32c 4078 example: Decided to ban the server since it spams us regularly
3e9e6f2f
RK
4079 video:
4080 type: object
4081 properties:
4082 id:
06746a8b 4083 type: integer
3e9e6f2f
RK
4084 name:
4085 type: string
4086 uuid:
4087 type: string
84f6e32c
RK
4088 format: uuid
4089 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4090 createdAt:
4091 type: string
84f6e32c 4092 format: date-time
668b7f09
C
4093 AbuseMessage:
4094 properties:
4095 id:
4096 type: integer
4097 message:
4098 type: string
4099 byModerator:
4100 type: boolean
4101 createdAt:
4102 type: string
4103 format: date-time
4104 account:
4105 $ref: '#/components/schemas/AccountSummary'
3e9e6f2f
RK
4106 VideoBlacklist:
4107 properties:
4108 id:
06746a8b 4109 type: integer
3e9e6f2f 4110 videoId:
06746a8b 4111 type: integer
3e9e6f2f
RK
4112 createdAt:
4113 type: string
84f6e32c 4114 format: date-time
3e9e6f2f
RK
4115 updatedAt:
4116 type: string
84f6e32c 4117 format: date-time
3e9e6f2f
RK
4118 name:
4119 type: string
4120 uuid:
4121 type: string
84f6e32c
RK
4122 format: uuid
4123 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4124 description:
4125 type: string
4126 duration:
06746a8b 4127 type: integer
3e9e6f2f 4128 views:
06746a8b 4129 type: integer
3e9e6f2f 4130 likes:
06746a8b 4131 type: integer
3e9e6f2f 4132 dislikes:
06746a8b 4133 type: integer
3e9e6f2f
RK
4134 nsfw:
4135 type: boolean
4136 VideoChannel:
4137 properties:
4138 displayName:
4139 type: string
4140 description:
4141 type: string
4142 isLocal:
4143 type: boolean
4144 ownerAccount:
4145 type: object
4146 properties:
4147 id:
06746a8b 4148 type: integer
3e9e6f2f
RK
4149 uuid:
4150 type: string
84f6e32c
RK
4151 format: uuid
4152 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
71810d0b
RK
4153 VideoPlaylist:
4154 properties:
4155 id:
06746a8b 4156 type: integer
71810d0b
RK
4157 createdAt:
4158 type: string
84f6e32c 4159 format: date-time
71810d0b
RK
4160 updatedAt:
4161 type: string
84f6e32c 4162 format: date-time
71810d0b
RK
4163 description:
4164 type: string
4165 uuid:
4166 type: string
84f6e32c
RK
4167 format: uuid
4168 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
71810d0b
RK
4169 displayName:
4170 type: string
4171 isLocal:
4172 type: boolean
4173 videoLength:
06746a8b 4174 type: integer
71810d0b
RK
4175 thumbnailPath:
4176 type: string
4177 privacy:
c1843150 4178 $ref: '#/components/schemas/VideoPlaylistPrivacyConstant'
71810d0b 4179 type:
c1843150 4180 $ref: '#/components/schemas/VideoPlaylistTypeConstant'
71810d0b 4181 ownerAccount:
c1843150
C
4182 $ref: '#/components/schemas/AccountSummary'
4183 videoChannel:
4184 $ref: '#/components/schemas/VideoChannelSummary'
3e9e6f2f
RK
4185 VideoComment:
4186 properties:
4187 id:
06746a8b 4188 type: integer
3e9e6f2f
RK
4189 url:
4190 type: string
84f6e32c 4191 format: url
3e9e6f2f
RK
4192 text:
4193 type: string
4194 threadId:
06746a8b 4195 type: integer
3e9e6f2f 4196 inReplyToCommentId:
06746a8b 4197 type: integer
3e9e6f2f 4198 videoId:
06746a8b 4199 type: integer
3e9e6f2f
RK
4200 createdAt:
4201 type: string
84f6e32c 4202 format: date-time
3e9e6f2f
RK
4203 updatedAt:
4204 type: string
84f6e32c 4205 format: date-time
5b0413dd 4206 totalRepliesFromVideoAuthor:
06746a8b 4207 type: integer
3e9e6f2f 4208 totalReplies:
06746a8b 4209 type: integer
3e9e6f2f
RK
4210 account:
4211 $ref: '#/components/schemas/Account'
4212 VideoCommentThreadTree:
4213 properties:
4214 comment:
4215 $ref: '#/components/schemas/VideoComment'
4216 children:
4217 type: array
4218 items:
4219 $ref: '#/components/schemas/VideoCommentThreadTree'
67ae04a5
C
4220 VideoCaption:
4221 properties:
4222 language:
4223 $ref: '#/components/schemas/VideoConstantString'
4224 captionPath:
4225 type: string
3e9e6f2f
RK
4226 Avatar:
4227 properties:
4228 path:
4229 type: string
4230 createdAt:
4231 type: string
84f6e32c 4232 format: date-time
3e9e6f2f
RK
4233 updatedAt:
4234 type: string
84f6e32c 4235 format: date-time
f4d59981
RK
4236 ActorInfo:
4237 properties:
4238 id:
4239 type: integer
84f6e32c 4240 example: 11
f4d59981
RK
4241 name:
4242 type: string
4243 displayName:
4244 type: string
4245 host:
4246 type: string
84f6e32c 4247 format: hostname
f4d59981
RK
4248 avatar:
4249 nullable: true
4250 type: object
4251 properties:
4252 path:
4253 type: string
3e9e6f2f
RK
4254 Actor:
4255 properties:
4256 id:
06746a8b 4257 type: integer
84f6e32c 4258 example: 11
3e9e6f2f
RK
4259 url:
4260 type: string
84f6e32c 4261 format: url
3e9e6f2f
RK
4262 name:
4263 type: string
4264 host:
4265 type: string
84f6e32c 4266 format: hostname
3e9e6f2f 4267 followingCount:
06746a8b 4268 type: integer
3e9e6f2f 4269 followersCount:
06746a8b 4270 type: integer
3e9e6f2f
RK
4271 createdAt:
4272 type: string
84f6e32c 4273 format: date-time
3e9e6f2f
RK
4274 updatedAt:
4275 type: string
84f6e32c 4276 format: date-time
3e9e6f2f
RK
4277 avatar:
4278 $ref: '#/components/schemas/Avatar'
4279 Account:
4280 allOf:
4281 - $ref: '#/components/schemas/Actor'
4282 - properties:
2a8ae759
FS
4283 userId:
4284 type: string
84f6e32c 4285 example: 2
3e9e6f2f
RK
4286 displayName:
4287 type: string
2a8ae759
FS
4288 description:
4289 type: string
6441981b
RK
4290 UserWatchingVideo:
4291 properties:
4292 currentTime:
06746a8b 4293 type: integer
84f6e32c
RK
4294 description: timestamp within the video, in seconds
4295 example: 5
3e9e6f2f
RK
4296 ServerConfig:
4297 properties:
2a8ae759
FS
4298 instance:
4299 type: object
4300 properties:
4301 name:
4302 type: string
4303 shortDescription:
4304 type: string
4305 defaultClientRoute:
4306 type: string
4307 isNSFW:
4308 type: boolean
4309 defaultNSFWPolicy:
4310 type: string
4311 customizations:
4312 type: object
4313 properties:
4314 javascript:
4315 type: string
4316 css:
4317 type: string
f30736c8
RK
4318 search:
4319 type: object
4320 properties:
4321 remoteUri:
4322 type: object
4323 properties:
4324 users:
4325 type: boolean
4326 anonymous:
4327 type: boolean
2a8ae759
FS
4328 plugin:
4329 type: object
4330 properties:
4331 registered:
4332 type: array
4333 items:
4334 type: string
4335 theme:
4336 type: object
4337 properties:
4338 registered:
4339 type: array
4340 items:
4341 type: string
4342 email:
4343 type: object
4344 properties:
4345 enabled:
4346 type: boolean
4347 contactForm:
4348 type: object
4349 properties:
4350 enabled:
4351 type: boolean
4352 serverVersion:
4353 type: string
4354 serverCommit:
4355 type: string
3e9e6f2f
RK
4356 signup:
4357 type: object
4358 properties:
4359 allowed:
4360 type: boolean
2a8ae759
FS
4361 allowedForCurrentIP:
4362 type: boolean
4363 requiresEmailVerification:
4364 type: boolean
3e9e6f2f
RK
4365 transcoding:
4366 type: object
4367 properties:
2a8ae759
FS
4368 hls:
4369 type: object
4370 properties:
4371 enabled:
4372 type: boolean
f30736c8
RK
4373 webtorrent:
4374 type: object
4375 properties:
4376 enabled:
4377 type: boolean
3e9e6f2f
RK
4378 enabledResolutions:
4379 type: array
4380 items:
06746a8b 4381 type: integer
2a8ae759
FS
4382 import:
4383 type: object
4384 properties:
4385 videos:
4386 type: object
4387 properties:
4388 http:
4389 type: object
4390 properties:
4391 enabled:
4392 type: boolean
4393 torrent:
4394 type: object
4395 properties:
4396 enabled:
4397 type: boolean
4398 autoBlacklist:
4399 type: object
4400 properties:
4401 videos:
4402 type: object
4403 properties:
4404 ofUsers:
4405 type: object
4406 properties:
4407 enabled:
4408 type: boolean
3e9e6f2f
RK
4409 avatar:
4410 type: object
4411 properties:
4412 file:
4413 type: object
4414 properties:
4415 size:
4416 type: object
4417 properties:
4418 max:
06746a8b 4419 type: integer
3e9e6f2f
RK
4420 extensions:
4421 type: array
4422 items:
4423 type: string
4424 video:
4425 type: object
4426 properties:
2a8ae759
FS
4427 image:
4428 type: object
4429 properties:
4430 extensions:
4431 type: array
4432 items:
4433 type: string
4434 size:
4435 type: object
4436 properties:
4437 max:
06746a8b 4438 type: integer
3e9e6f2f
RK
4439 file:
4440 type: object
4441 properties:
4442 extensions:
4443 type: array
4444 items:
4445 type: string
2a8ae759
FS
4446 videoCaption:
4447 type: object
4448 properties:
4449 file:
4450 type: object
4451 properties:
4452 size:
4453 type: object
4454 properties:
4455 max:
06746a8b 4456 type: integer
2a8ae759
FS
4457 extensions:
4458 type: array
4459 items:
4460 type: string
4461 user:
4462 type: object
4463 properties:
4464 videoQuota:
06746a8b 4465 type: integer
2a8ae759 4466 videoQuotaDaily:
06746a8b 4467 type: integer
2a8ae759
FS
4468 trending:
4469 type: object
4470 properties:
4471 videos:
4472 type: object
4473 properties:
4474 intervalDays:
06746a8b 4475 type: integer
2a8ae759 4476 tracker:
747b17c7 4477 type: object
2a8ae759
FS
4478 properties:
4479 enabled:
4480 type: boolean
f30736c8
RK
4481 followings:
4482 type: object
4483 properties:
4484 instance:
4485 type: object
4486 properties:
4487 autoFollowIndex:
4488 type: object
4489 properties:
4490 indexUrl:
4491 type: string
84f6e32c 4492 format: url
2a8ae759
FS
4493 ServerConfigAbout:
4494 properties:
4495 instance:
4496 type: object
4497 properties:
4498 name:
4499 type: string
4500 shortDescription:
4501 type: string
4502 description:
4503 type: string
4504 terms:
4505 type: string
4506 ServerConfigCustom:
4507 properties:
4508 instance:
4509 type: object
4510 properties:
4511 name:
4512 type: string
4513 shortDescription:
4514 type: string
4515 description:
4516 type: string
4517 terms:
4518 type: string
4519 defaultClientRoute:
4520 type: string
4521 isNSFW:
4522 type: boolean
4523 defaultNSFWPolicy:
4524 type: string
4525 customizations:
4526 type: object
4527 properties:
4528 javascript:
4529 type: string
4530 css:
4531 type: string
4532 theme:
4533 type: object
4534 properties:
4535 default:
4536 type: string
4537 services:
4538 type: object
4539 properties:
4540 twitter:
4541 type: object
4542 properties:
4543 username:
4544 type: string
4545 whitelisted:
4546 type: boolean
4547 cache:
4548 type: object
4549 properties:
4550 previews:
4551 type: object
4552 properties:
4553 size:
06746a8b 4554 type: integer
2a8ae759
FS
4555 captions:
4556 type: object
4557 properties:
4558 size:
06746a8b 4559 type: integer
2a8ae759
FS
4560 signup:
4561 type: object
4562 properties:
4563 enabled:
4564 type: boolean
4565 limit:
06746a8b 4566 type: integer
2a8ae759
FS
4567 requiresEmailVerification:
4568 type: boolean
4569 admin:
4570 type: object
4571 properties:
4572 email:
4573 type: string
84f6e32c 4574 format: email
2a8ae759
FS
4575 contactForm:
4576 type: object
4577 properties:
4578 enabled:
4579 type: boolean
4580 user:
4581 type: object
4582 properties:
4583 videoQuota:
06746a8b 4584 type: integer
2a8ae759 4585 videoQuotaDaily:
06746a8b 4586 type: integer
2a8ae759
FS
4587 transcoding:
4588 type: object
4589 properties:
4590 enabled:
4591 type: boolean
4592 allowAdditionalExtensions:
4593 type: boolean
4594 allowAudioFiles:
4595 type: boolean
4596 threads:
06746a8b 4597 type: integer
2a8ae759
FS
4598 resolutions:
4599 type: object
4600 properties:
4601 240p:
4602 type: boolean
4603 360p:
4604 type: boolean
4605 480p:
4606 type: boolean
4607 720p:
4608 type: boolean
4609 1080p:
4610 type: boolean
4611 2160p:
4612 type: boolean
4613 hls:
4614 type: object
4615 properties:
4616 enabled:
4617 type: boolean
4618 import:
4619 type: object
4620 properties:
4621 videos:
4622 type: object
4623 properties:
4624 http:
4625 type: object
4626 properties:
4627 enabled:
4628 type: boolean
4629 torrent:
4630 type: object
4631 properties:
4632 enabled:
4633 type: boolean
4634 autoBlacklist:
4635 type: object
4636 properties:
4637 videos:
4638 type: object
4639 properties:
4640 ofUsers:
4641 type: object
4642 properties:
4643 enabled:
4644 type: boolean
4645 followers:
4646 type: object
4647 properties:
4648 instance:
4649 type: object
4650 properties:
4651 enabled:
4652 type: boolean
4653 manualApproval:
4654 type: boolean
3e9e6f2f
RK
4655 Follow:
4656 properties:
4657 id:
06746a8b 4658 type: integer
3e9e6f2f
RK
4659 follower:
4660 $ref: '#/components/schemas/Actor'
4661 following:
4662 $ref: '#/components/schemas/Actor'
4663 score:
4664 type: number
04b703f6 4665 description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`.
3e9e6f2f
RK
4666 state:
4667 type: string
4668 enum:
4669 - pending
4670 - accepted
4671 createdAt:
4672 type: string
84f6e32c 4673 format: date-time
3e9e6f2f
RK
4674 updatedAt:
4675 type: string
84f6e32c 4676 format: date-time
e3489df9
C
4677
4678 PredefinedAbuseReasons:
4679 description: Reason categories that help triage reports
4680 type: array
4681 items:
4682 type: string
4683 enum:
4684 - violentOrAbusive
4685 - hatefulOrAbusive
4686 - spamOrMisleading
4687 - privacy
4688 - rights
4689 - serverRules
4690 - thumbnails
4691 - captions
4692
3e9e6f2f
RK
4693 Job:
4694 properties:
4695 id:
06746a8b 4696 type: integer
84f6e32c
RK
4697 minimum: 0
4698 example: 42
3e9e6f2f
RK
4699 state:
4700 type: string
4701 enum:
84f6e32c
RK
4702 - active
4703 - completed
4704 - failed
4705 - waiting
4706 - delayed
4707 type:
3e9e6f2f
RK
4708 type: string
4709 enum:
84f6e32c
RK
4710 - activitypub-http-unicast
4711 - activitypub-http-broadcast
4712 - activitypub-http-fetcher
4713 - activitypub-follow
4714 - video-file-import
4715 - video-transcoding
4716 - email
4717 - video-import
4718 - videos-views
4719 - activitypub-refresher
4720 - video-redundancy
4721 data:
4722 type: object
4723 additionalProperties: true
4724 error:
4725 type: object
4726 additionalProperties: true
3e9e6f2f
RK
4727 createdAt:
4728 type: string
84f6e32c
RK
4729 format: date-time
4730 finishedOn:
3e9e6f2f 4731 type: string
84f6e32c
RK
4732 format: date-time
4733 processedOn:
4734 type: string
4735 format: date-time
3e9e6f2f
RK
4736 AddUserResponse:
4737 properties:
2c318664
RK
4738 user:
4739 type: object
4740 properties:
4741 id:
4742 type: integer
4743 example: 8
4744 account:
4745 type: object
4746 properties:
4747 id:
4748 type: integer
4749 example: 37
3e9e6f2f
RK
4750 VideoUploadResponse:
4751 properties:
4752 video:
4753 type: object
4754 properties:
4755 id:
06746a8b 4756 type: integer
84f6e32c 4757 example: 8
3e9e6f2f
RK
4758 uuid:
4759 type: string
84f6e32c
RK
4760 format: uuid
4761 example: 9c9de5e8-0a1e-484a-b099-e80766180a6d
3e9e6f2f
RK
4762 CommentThreadResponse:
4763 properties:
4764 total:
06746a8b 4765 type: integer
84f6e32c 4766 example: 1
3e9e6f2f
RK
4767 data:
4768 type: array
84f6e32c 4769 maxItems: 100
3e9e6f2f
RK
4770 items:
4771 $ref: '#/components/schemas/VideoComment'
4772 CommentThreadPostResponse:
4773 properties:
4774 comment:
4775 $ref: '#/components/schemas/VideoComment'
048b6946
C
4776 VideoListResponse:
4777 properties:
4778 total:
06746a8b 4779 type: integer
84f6e32c 4780 example: 1
048b6946
C
4781 data:
4782 type: array
84f6e32c 4783 maxItems: 100
048b6946
C
4784 items:
4785 $ref: '#/components/schemas/Video'
84f6e32c
RK
4786 User:
4787 properties:
4788 id:
4789 type: integer
4790 readOnly: true
4791 username:
4792 type: string
4793 description: The user username
4794 minLength: 1
4795 maxLength: 50
4796 email:
4797 type: string
4798 format: email
4799 description: The user email
4800 theme:
4801 type: string
4802 description: Theme enabled by this user
4803 emailVerified:
4804 type: boolean
4805 description: Has the user confirmed their email address?
4806 nsfwPolicy:
4807 $ref: '#/components/schemas/NSFWPolicy'
4808 webtorrentEnabled:
4809 type: boolean
4810 description: Enable P2P in the player
4811 autoPlayVideo:
4812 type: boolean
4813 description: Automatically start playing the video on the watch page
4814 role:
4815 $ref: '#/components/schemas/UserRole'
4816 roleLabel:
4817 type: string
4818 enum:
4819 - User
4820 - Moderator
4821 - Administrator
4822 videoQuota:
4823 type: integer
4824 description: The user video quota
4825 videoQuotaDaily:
4826 type: integer
4827 description: The user daily video quota
4828 videosCount:
4829 type: integer
4f32032f 4830 abusesCount:
84f6e32c 4831 type: integer
4f32032f 4832 abusesAcceptedCount:
84f6e32c 4833 type: integer
4f32032f 4834 abusesCreatedCount:
84f6e32c
RK
4835 type: integer
4836 videoCommentsCount:
4837 type: integer
4838 noInstanceConfigWarningModal:
4839 type: boolean
4840 noWelcomeModal:
4841 type: boolean
4842 blocked:
4843 type: boolean
4844 blockedReason:
4845 type: string
4846 createdAt:
4847 type: string
4848 account:
4849 $ref: '#/components/schemas/Account'
4850 videoChannels:
4851 type: array
4852 items:
4853 $ref: '#/components/schemas/VideoChannel'
3e9e6f2f
RK
4854 AddUser:
4855 properties:
4856 username:
4857 type: string
84f6e32c 4858 description: The user username
06746a8b
RK
4859 minLength: 1
4860 maxLength: 50
3e9e6f2f
RK
4861 password:
4862 type: string
84f6e32c
RK
4863 format: password
4864 description: The user password. If the smtp server is configured, you can leave empty and an email will be sent
06746a8b
RK
4865 minLength: 6
4866 maxLength: 255
3e9e6f2f
RK
4867 email:
4868 type: string
84f6e32c
RK
4869 format: email
4870 description: The user email
3e9e6f2f 4871 videoQuota:
84f6e32c
RK
4872 type: integer
4873 description: The user video quota
fbe1bc2a 4874 videoQuotaDaily:
84f6e32c
RK
4875 type: integer
4876 description: The user daily video quota
3e9e6f2f 4877 role:
0590bb46 4878 $ref: '#/components/schemas/UserRole'
3e9e6f2f
RK
4879 required:
4880 - username
4881 - password
4882 - email
4883 - videoQuota
fbe1bc2a 4884 - videoQuotaDaily
3e9e6f2f
RK
4885 - role
4886 UpdateUser:
4887 properties:
4888 id:
4889 type: string
84f6e32c 4890 description: The user id
3e9e6f2f
RK
4891 email:
4892 type: string
84f6e32c
RK
4893 format: email
4894 description: The updated email of the user
3e9e6f2f 4895 videoQuota:
84f6e32c
RK
4896 type: integer
4897 description: The updated video quota of the user
fbe1bc2a 4898 videoQuotaDaily:
84f6e32c
RK
4899 type: integer
4900 description: The updated daily video quota of the user
3e9e6f2f 4901 role:
0590bb46 4902 $ref: '#/components/schemas/UserRole'
3e9e6f2f
RK
4903 required:
4904 - id
4905 - email
4906 - videoQuota
fbe1bc2a 4907 - videoQuotaDaily
3e9e6f2f
RK
4908 - role
4909 UpdateMe:
4910 properties:
4911 password:
4912 type: string
84f6e32c
RK
4913 format: password
4914 description: Your new password
4915 minLength: 6
4916 maxLength: 255
3e9e6f2f
RK
4917 email:
4918 type: string
84f6e32c
RK
4919 format: email
4920 description: Your new email
3e9e6f2f
RK
4921 displayNSFW:
4922 type: string
84f6e32c
RK
4923 description: Your new displayNSFW
4924 enum:
4925 - 'true'
4926 - 'false'
4927 - both
3e9e6f2f 4928 autoPlayVideo:
84f6e32c
RK
4929 type: boolean
4930 description: Your new autoPlayVideo
3e9e6f2f
RK
4931 required:
4932 - password
4933 - email
4934 - displayNSFW
4935 - autoPlayVideo
4936 GetMeVideoRating:
4937 properties:
4938 id:
4939 type: string
84f6e32c 4940 description: Id of the video
3e9e6f2f
RK
4941 rating:
4942 type: number
84f6e32c 4943 description: Rating of the video
3e9e6f2f
RK
4944 required:
4945 - id
4946 - rating
c100a614
YB
4947 VideoRating:
4948 properties:
4949 video:
4950 $ref: '#/components/schemas/Video'
4951 rating:
4952 type: number
4953 description: 'Rating of the video'
4954 required:
4955 - video
4956 - rating
3e9e6f2f
RK
4957 RegisterUser:
4958 properties:
4959 username:
4960 type: string
84f6e32c
RK
4961 description: The username of the user
4962 minLength: 1
4963 maxLength: 50
4964 pattern: '/^[a-z0-9._]{1,50}$/'
3e9e6f2f
RK
4965 password:
4966 type: string
84f6e32c
RK
4967 format: password
4968 description: The password of the user
4969 minLength: 6
4970 maxLength: 255
3e9e6f2f
RK
4971 email:
4972 type: string
84f6e32c
RK
4973 format: email
4974 description: The email of the user
1f20622f
C
4975 displayName:
4976 type: string
84f6e32c
RK
4977 description: The user display name
4978 minLength: 1
4979 maxLength: 120
1f20622f
C
4980 channel:
4981 type: object
4982 properties:
4983 name:
4984 type: string
84f6e32c
RK
4985 description: The name for the default channel
4986 pattern: '/^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\\-_.:]+$/'
1f20622f
C
4987 displayName:
4988 type: string
84f6e32c
RK
4989 description: The display name for the default channel
4990 minLength: 1
4991 maxLength: 120
3e9e6f2f
RK
4992 required:
4993 - username
4994 - password
4995 - email
7d14d4d2 4996 VideoChannelCreate:
3e9e6f2f
RK
4997 properties:
4998 name:
4999 type: string
7d14d4d2
C
5000 displayName:
5001 type: string
3e9e6f2f
RK
5002 description:
5003 type: string
7d14d4d2
C
5004 support:
5005 type: string
06746a8b 5006 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
00494d6e 5007 example: Please support my work on <insert crowdfunding plateform>! <3
7d14d4d2
C
5008 required:
5009 - name
5010 - displayName
5011 VideoChannelUpdate:
5012 properties:
5013 displayName:
5014 type: string
5015 description:
5016 type: string
5017 support:
5018 type: string
06746a8b 5019 description: 'A text shown by default on all videos of this channel, to tell the audience how to support it'
00494d6e 5020 example: Please support my work on <insert crowdfunding plateform>! <3
7d14d4d2
C
5021 bulkVideosSupportUpdate:
5022 type: boolean
06746a8b 5023 description: 'Update the support field for all videos of this channel'
1569a818 5024
06746a8b
RK
5025 MRSSPeerLink:
5026 type: object
5027 xml:
5028 name: 'media:peerLink'
5029 properties:
5030 href:
5031 type: string
5032 xml:
5033 attribute: true
5034 type:
5035 type: string
5036 enum:
5037 - application/x-bittorrent
5038 xml:
5039 attribute: true
5040 MRSSGroupContent:
5041 type: object
5042 xml:
5043 name: 'media:content'
5044 properties:
5045 url:
5046 type: string
84f6e32c 5047 format: url
06746a8b
RK
5048 xml:
5049 attribute: true
5050 fileSize:
5051 type: integer
5052 xml:
5053 attribute: true
5054 type:
5055 type: string
5056 xml:
5057 attribute: true
5058 framerate:
5059 type: integer
5060 xml:
5061 attribute: true
5062 duration:
5063 type: integer
5064 xml:
5065 attribute: true
5066 height:
5067 type: integer
5068 xml:
5069 attribute: true
5070 lang:
5071 type: string
5072 xml:
5073 attribute: true
5074 VideoCommentsForXML:
5075 type: array
5076 xml:
5077 wrapped: true
5078 name: 'channel'
5079 items:
5080 type: object
5081 xml:
5082 name: 'item'
5083 properties:
5084 link:
5085 type: string
84f6e32c 5086 format: url
06746a8b
RK
5087 guid:
5088 type: string
5089 pubDate:
5090 type: string
5091 format: date-time
5092 'content:encoded':
5093 type: string
5094 'dc:creator':
5095 type: string
5096 VideosForXML:
5097 type: array
5098 xml:
5099 wrapped: true
5100 name: 'channel'
5101 items:
5102 type: object
5103 xml:
5104 name: 'item'
5105 properties:
5106 link:
5107 type: string
84f6e32c 5108 format: url
06746a8b
RK
5109 description: video watch page URL
5110 guid:
5111 type: string
5112 description: video canonical URL
5113 pubDate:
5114 type: string
5115 format: date-time
5116 description: video publication date
5117 description:
5118 type: string
5119 description: video description
5120 'content:encoded':
5121 type: string
5122 description: video description
5123 'dc:creator':
5124 type: string
5125 description: publisher user name
5126 'media:category':
5127 type: integer
5128 description: video category (MRSS)
5129 'media:community':
5130 type: object
5131 description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS)
5132 properties:
5133 'media:statistics':
5134 type: object
5135 properties:
5136 views:
5137 type: integer
5138 xml:
5139 attribute: true
5140 'media:embed':
5141 type: object
5142 properties:
5143 url:
5144 type: string
84f6e32c 5145 format: url
06746a8b
RK
5146 description: video embed path, relative to the canonical URL domain (MRSS)
5147 xml:
5148 attribute: true
5149 'media:player':
5150 type: object
5151 properties:
5152 url:
5153 type: string
84f6e32c 5154 format: url
06746a8b
RK
5155 description: video watch path, relative to the canonical URL domain (MRSS)
5156 xml:
5157 attribute: true
5158 'media:thumbnail':
5159 type: object
5160 properties:
5161 url:
5162 type: string
84f6e32c 5163 format: url
06746a8b
RK
5164 xml:
5165 attribute: true
5166 height:
5167 type: integer
5168 xml:
5169 attribute: true
5170 width:
5171 type: integer
5172 xml:
5173 attribute: true
5174 'media:title':
5175 type: string
5176 description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles.
5177 'media:description':
5178 type: string
5179 'media:rating':
5180 type: string
5181 enum:
5182 - nonadult
5183 - adult
5184 description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS)
5185 'enclosure':
5186 type: object
5187 description: main streamable file for the video
5188 properties:
5189 url:
5190 type: string
84f6e32c 5191 format: url
06746a8b
RK
5192 xml:
5193 attribute: true
5194 type:
5195 type: string
5196 enum:
5197 - application/x-bittorrent
5198 xml:
5199 attribute: true
5200 length:
5201 type: integer
5202 xml:
5203 attribute: true
5204 'media:group':
5205 type: array
5206 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)
5207 items:
5208 anyOf:
5209 - $ref: '#/components/schemas/MRSSPeerLink'
f4d59981
RK
5210 - $ref: '#/components/schemas/MRSSGroupContent'
5211 NotificationSettingValue:
5212 type: integer
5213 description: >
5214 Notification type
84f6e32c 5215
f4d59981 5216 - `0` NONE
84f6e32c 5217
f4d59981 5218 - `1` WEB
84f6e32c 5219
f4d59981
RK
5220 - `2` EMAIL
5221 enum:
5222 - 0
5223 - 1
5224 - 3
5225 Notification:
5226 properties:
5227 id:
5228 type: integer
5229 type:
5230 type: integer
5231 description: >
5232 Notification type, following the `UserNotificationType` enum:
84f6e32c 5233
f4d59981 5234 - `1` NEW_VIDEO_FROM_SUBSCRIPTION
84f6e32c 5235
f4d59981 5236 - `2` NEW_COMMENT_ON_MY_VIDEO
84f6e32c 5237
310b5219 5238 - `3` NEW_ABUSE_FOR_MODERATORS
84f6e32c 5239
f4d59981 5240 - `4` BLACKLIST_ON_MY_VIDEO
84f6e32c 5241
f4d59981 5242 - `5` UNBLACKLIST_ON_MY_VIDEO
84f6e32c 5243
f4d59981 5244 - `6` MY_VIDEO_PUBLISHED
84f6e32c 5245
f4d59981 5246 - `7` MY_VIDEO_IMPORT_SUCCESS
84f6e32c 5247
f4d59981 5248 - `8` MY_VIDEO_IMPORT_ERROR
84f6e32c 5249
f4d59981 5250 - `9` NEW_USER_REGISTRATION
84f6e32c 5251
f4d59981 5252 - `10` NEW_FOLLOW
84f6e32c 5253
f4d59981 5254 - `11` COMMENT_MENTION
84f6e32c 5255
f4d59981 5256 - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
84f6e32c 5257
f4d59981 5258 - `13` NEW_INSTANCE_FOLLOWER
84f6e32c 5259
f4d59981
RK
5260 - `14` AUTO_INSTANCE_FOLLOWING
5261 read:
5262 type: boolean
5263 video:
5264 nullable: true
5265 allOf:
5266 - $ref: '#/components/schemas/VideoInfo'
5267 - type: object
5268 properties:
5269 channel:
5270 $ref: '#/components/schemas/ActorInfo'
5271 videoImport:
5272 nullable: true
5273 type: object
5274 properties:
5275 id:
5276 type: integer
5277 video:
5278 nullable: true
5279 $ref: '#/components/schemas/VideoInfo'
5280 torrentName:
5281 type: string
5282 nullable: true
5283 magnetUri:
5284 type: string
84f6e32c 5285 format: uri
f4d59981
RK
5286 nullable: true
5287 targetUri:
5288 type: string
84f6e32c 5289 format: uri
f4d59981
RK
5290 nullable: true
5291 comment:
5292 nullable: true
5293 type: object
5294 properties:
5295 id:
5296 type: integer
5297 threadId:
5298 type: integer
5299 video:
5300 $ref: '#/components/schemas/VideoInfo'
5301 account:
5302 $ref: '#/components/schemas/ActorInfo'
5303 videoAbuse:
5304 nullable: true
5305 type: object
5306 properties:
5307 id:
5308 type: integer
5309 video:
5310 allOf:
5311 - $ref: '#/components/schemas/VideoInfo'
5312 videoBlacklist:
5313 nullable: true
5314 type: object
5315 properties:
5316 id:
5317 type: integer
5318 video:
5319 allOf:
5320 - $ref: '#/components/schemas/VideoInfo'
5321 account:
5322 nullable: true
5323 allOf:
5324 - $ref: '#/components/schemas/ActorInfo'
5325 actorFollow:
5326 type: object
5327 nullable: true
5328 properties:
5329 id:
5330 type: integer
5331 follower:
5332 $ref: '#/components/schemas/ActorInfo'
5333 state:
5334 type: string
5335 enum:
5336 - pending
5337 - accepted
5338 following:
5339 type: object
5340 properties:
5341 type:
5342 type: string
5343 enum:
5344 - account
5345 - channel
5346 - instance
5347 name:
5348 type: string
5349 displayName:
5350 type: string
5351 host:
5352 type: string
84f6e32c 5353 format: hostname
f4d59981
RK
5354 createdAt:
5355 type: string
5356 format: date-time
5357 updatedAt:
5358 type: string
5359 format: date-time
5360 NotificationListResponse:
5361 properties:
5362 total:
5363 type: integer
84f6e32c 5364 example: 1
f4d59981
RK
5365 data:
5366 type: array
84f6e32c 5367 maxItems: 100
f4d59981 5368 items:
7461d440
RK
5369 $ref: '#/components/schemas/Notification'
5370 Plugin:
5371 properties:
5372 name:
5373 type: string
84f6e32c 5374 example: peertube-plugin-auth-ldap
7461d440
RK
5375 type:
5376 type: integer
84f6e32c
RK
5377 description: >
5378 - `1`: PLUGIN
5379
5380 - `2`: THEME
7461d440
RK
5381 enum:
5382 - 1
5383 - 2
5384 latestVersion:
5385 type: string
84f6e32c 5386 example: 0.0.3
7461d440
RK
5387 version:
5388 type: string
84f6e32c 5389 example: 0.0.1
7461d440
RK
5390 enabled:
5391 type: boolean
5392 uninstalled:
5393 type: boolean
5394 peertubeEngine:
5395 type: string
84f6e32c 5396 example: 2.2.0
7461d440
RK
5397 description:
5398 type: string
5399 homepage:
5400 type: string
84f6e32c
RK
5401 format: url
5402 example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap
7461d440
RK
5403 settings:
5404 type: object
5405 additionalProperties: true
5406 createdAt:
5407 type: string
5408 format: date-time
5409 updatedAt:
5410 type: string
5411 format: date-time
5412 PluginResponse:
5413 properties:
5414 total:
5415 type: integer
84f6e32c 5416 example: 1
7461d440
RK
5417 data:
5418 type: array
84f6e32c 5419 maxItems: 100
7461d440 5420 items:
2c318664
RK
5421 $ref: '#/components/schemas/Plugin'
5422 callbacks:
5423 searchIndex:
c00f96ce 5424 'https://search.example.org/api/v1/search/videos':
2c318664
RK
5425 post:
5426 summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget`
5427 responses:
5428 '200':
5429 description: successful operation
5430 content:
5431 application/json:
5432 schema:
1e904cde 5433 $ref: '#/components/schemas/VideoListResponse'