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