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