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