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