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