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