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