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