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