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