]>
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 |
37db4176 FS |
1743 | originallyPublishedAt: |
1744 | description: Date when the content was originally published | |
1745 | type: string | |
1746 | format: date-time | |
5dce26d2 C |
1747 | scheduleUpdate: |
1748 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
0ad45af7 FS |
1749 | encoding: |
1750 | thumbnailfile: | |
1751 | contentType: image/jpeg | |
1752 | previewfile: | |
1753 | contentType: image/jpeg | |
1569a818 | 1754 | get: |
b029d58a | 1755 | summary: Get a video |
3f71c4c0 | 1756 | operationId: getVideo |
1569a818 DG |
1757 | tags: |
1758 | - Video | |
1569a818 | 1759 | parameters: |
cb9d028a | 1760 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1761 | responses: |
1762 | '200': | |
1763 | description: successful operation | |
3e9e6f2f RK |
1764 | content: |
1765 | application/json: | |
1766 | schema: | |
5dce26d2 | 1767 | $ref: '#/components/schemas/VideoDetails' |
1569a818 | 1768 | delete: |
b029d58a | 1769 | summary: Delete a video |
3f71c4c0 | 1770 | operationId: delVideo |
94ff4c23 | 1771 | security: |
3e9e6f2f | 1772 | - OAuth2: [] |
1569a818 DG |
1773 | tags: |
1774 | - Video | |
1569a818 | 1775 | parameters: |
cb9d028a | 1776 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1777 | responses: |
1778 | '204': | |
c1843150 | 1779 | description: successful operation |
3f71c4c0 | 1780 | |
3e9e6f2f | 1781 | '/videos/{id}/description': |
1569a818 | 1782 | get: |
b029d58a | 1783 | summary: Get complete video description |
3f71c4c0 | 1784 | operationId: getVideoDesc |
1569a818 DG |
1785 | tags: |
1786 | - Video | |
1569a818 | 1787 | parameters: |
cb9d028a | 1788 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1789 | responses: |
1790 | '200': | |
1791 | description: successful operation | |
3e9e6f2f RK |
1792 | content: |
1793 | application/json: | |
1794 | schema: | |
b8375da9 | 1795 | nullable: true |
3e9e6f2f | 1796 | type: string |
b8375da9 RK |
1797 | minLength: 3 |
1798 | maxLength: 10000 | |
1799 | example: | | |
1800 | **[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 | 1801 | |
3e9e6f2f | 1802 | '/videos/{id}/views': |
1569a818 | 1803 | post: |
b029d58a | 1804 | summary: Add a view to a video |
c756bae0 | 1805 | operationId: addView |
1569a818 DG |
1806 | tags: |
1807 | - Video | |
1569a818 | 1808 | parameters: |
cb9d028a | 1809 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
1810 | responses: |
1811 | '204': | |
c1843150 | 1812 | description: successful operation |
3f71c4c0 | 1813 | |
6441981b RK |
1814 | '/videos/{id}/watching': |
1815 | put: | |
b029d58a | 1816 | summary: Set watching progress of a video |
c756bae0 | 1817 | operationId: setProgress |
6441981b RK |
1818 | tags: |
1819 | - Video | |
1820 | security: | |
1821 | - OAuth2: [] | |
1822 | parameters: | |
cb9d028a | 1823 | - $ref: '#/components/parameters/idOrUUID' |
6441981b RK |
1824 | requestBody: |
1825 | content: | |
1826 | application/json: | |
1827 | schema: | |
1828 | $ref: '#/components/schemas/UserWatchingVideo' | |
1829 | required: true | |
1830 | responses: | |
1831 | '204': | |
c1843150 | 1832 | description: successful operation |
3f71c4c0 | 1833 | |
c360c494 | 1834 | /videos/upload: |
1569a818 | 1835 | post: |
b029d58a | 1836 | summary: Upload a video |
f6d6e7f8 | 1837 | description: Uses a single request to upload a video. |
40cfb36b | 1838 | operationId: uploadLegacy |
94ff4c23 | 1839 | security: |
3e9e6f2f | 1840 | - OAuth2: [] |
1569a818 DG |
1841 | tags: |
1842 | - Video | |
f6d6e7f8 | 1843 | - Video Upload |
1569a818 DG |
1844 | responses: |
1845 | '200': | |
1846 | description: successful operation | |
3e9e6f2f RK |
1847 | content: |
1848 | application/json: | |
1849 | schema: | |
1850 | $ref: '#/components/schemas/VideoUploadResponse' | |
06bcfbd9 | 1851 | '403': |
f2eb23cd | 1852 | description: video didn't pass upload filter |
06bcfbd9 | 1853 | '408': |
84f6e32c | 1854 | description: upload has timed out |
d4132d3f | 1855 | '413': |
c756bae0 RK |
1856 | x-summary: video file too large, due to quota or max body size limit set by the reverse-proxy |
1857 | description: | | |
1858 | If the response has no body, it means the reverse-proxy didn't let it through. Otherwise disambiguate via `type`: | |
1859 | - `quota_reached` for quota limits wether daily or global | |
d4132d3f RK |
1860 | headers: |
1861 | X-File-Maximum-Size: | |
1862 | schema: | |
1863 | type: string | |
1864 | format: Nginx size | |
1865 | description: Maximum file size for the video | |
f2eb23cd RK |
1866 | '415': |
1867 | description: video type unsupported | |
06bcfbd9 | 1868 | '422': |
f2eb23cd | 1869 | description: video unreadable |
3e9e6f2f RK |
1870 | requestBody: |
1871 | content: | |
1872 | multipart/form-data: | |
1873 | schema: | |
f6d6e7f8 | 1874 | $ref: '#/components/schemas/VideoUploadRequestLegacy' |
0ad45af7 FS |
1875 | encoding: |
1876 | videofile: | |
1877 | contentType: video/mp4, video/webm, video/ogg, video/avi, video/quicktime, video/x-msvideo, video/x-flv, video/x-matroska, application/octet-stream | |
1878 | thumbnailfile: | |
1879 | contentType: image/jpeg | |
1880 | previewfile: | |
1881 | contentType: image/jpeg | |
40cfb36b | 1882 | x-codeSamples: |
8f9e8be1 RK |
1883 | - lang: Shell |
1884 | source: | | |
0579dee3 | 1885 | ## DEPENDENCIES: jq |
8f9e8be1 RK |
1886 | USERNAME="<your_username>" |
1887 | PASSWORD="<your_password>" | |
1888 | FILE_PATH="<your_file_path>" | |
1889 | CHANNEL_ID="<your_channel_id>" | |
8f9e8be1 | 1890 | NAME="<video_name>" |
3cf8874f | 1891 | API="https://peertube2.cpy.re/api/v1" |
8f9e8be1 | 1892 | |
8f9e8be1 | 1893 | ## AUTH |
3cf8874f RK |
1894 | client_id=$(curl -s "$API/oauth-clients/local" | jq -r ".client_id") |
1895 | client_secret=$(curl -s "$API/oauth-clients/local" | jq -r ".client_secret") | |
1896 | token=$(curl -s "$API/users/token" \ | |
0579dee3 JK |
1897 | --data client_id="$client_id" \ |
1898 | --data client_secret="$client_secret" \ | |
1899 | --data grant_type=password \ | |
0579dee3 JK |
1900 | --data username="$USERNAME" \ |
1901 | --data password="$PASSWORD" \ | |
8f9e8be1 | 1902 | | jq -r ".access_token") |
3cf8874f | 1903 | |
8f9e8be1 | 1904 | ## VIDEO UPLOAD |
3cf8874f | 1905 | curl -s "$API/videos/upload" \ |
0579dee3 JK |
1906 | -H "Authorization: Bearer $token" \ |
1907 | --max-time 600 \ | |
1908 | --form videofile=@"$FILE_PATH" \ | |
1909 | --form channelId=$CHANNEL_ID \ | |
1910 | --form name="$NAME" | |
3f71c4c0 | 1911 | |
f6d6e7f8 | 1912 | /videos/upload-resumable: |
1913 | post: | |
1914 | summary: Initialize the resumable upload of a video | |
1915 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to initialize the upload of a video | |
40cfb36b | 1916 | operationId: uploadResumableInit |
f6d6e7f8 | 1917 | security: |
1918 | - OAuth2: [] | |
1919 | tags: | |
1920 | - Video | |
1921 | - Video Upload | |
1922 | parameters: | |
1923 | - name: X-Upload-Content-Length | |
1924 | in: header | |
1925 | schema: | |
1926 | type: number | |
1927 | example: 2469036 | |
1928 | required: true | |
1929 | description: Number of bytes that will be uploaded in subsequent requests. Set this value to the size of the file you are uploading. | |
1930 | - name: X-Upload-Content-Type | |
1931 | in: header | |
1932 | schema: | |
1933 | type: string | |
1934 | format: mimetype | |
1935 | example: video/mp4 | |
1936 | required: true | |
1937 | description: MIME type of the file that you are uploading. Depending on your instance settings, acceptable values might vary. | |
1938 | requestBody: | |
1939 | content: | |
1940 | application/json: | |
1941 | schema: | |
1942 | $ref: '#/components/schemas/VideoUploadRequestResumable' | |
1943 | responses: | |
1944 | '200': | |
1945 | description: file already exists, send a [`resume`](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) request instead | |
1946 | '201': | |
1947 | description: created | |
1948 | headers: | |
1949 | Location: | |
1950 | schema: | |
1951 | type: string | |
1952 | format: url | |
1953 | example: /api/v1/videos/upload-resumable?upload_id=471e97554f21dec3b8bb5d4602939c51 | |
1954 | Content-Length: | |
1955 | schema: | |
1956 | type: number | |
1957 | example: 0 | |
f6d6e7f8 | 1958 | '413': |
c756bae0 RK |
1959 | x-summary: video file too large, due to quota, absolute max file size or concurrent partial upload limit |
1960 | description: | | |
1961 | Disambiguate via `type`: | |
1962 | - `max_file_size_reached` for the absolute file size limit | |
1963 | - `quota_reached` for quota limits whether daily or global | |
f6d6e7f8 | 1964 | '415': |
1965 | description: video type unsupported | |
1966 | put: | |
1967 | summary: Send chunk for the resumable upload of a video | |
1968 | 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 | 1969 | operationId: uploadResumable |
f6d6e7f8 | 1970 | security: |
1971 | - OAuth2: [] | |
1972 | tags: | |
1973 | - Video | |
1974 | - Video Upload | |
1975 | parameters: | |
1976 | - name: upload_id | |
c215e627 | 1977 | in: query |
f6d6e7f8 | 1978 | required: true |
1979 | description: | | |
1980 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | |
1981 | not valid anymore and you need to initialize a new upload. | |
1982 | schema: | |
1983 | type: string | |
1984 | - name: Content-Range | |
1985 | in: header | |
1986 | schema: | |
1987 | type: string | |
1988 | example: bytes 0-262143/2469036 | |
1989 | required: true | |
1990 | description: | | |
1991 | Specifies the bytes in the file that the request is uploading. | |
1992 | ||
1993 | For example, a value of `bytes 0-262143/1000000` shows that the request is sending the first | |
1994 | 262144 bytes (256 x 1024) in a 2,469,036 byte file. | |
1995 | - name: Content-Length | |
1996 | in: header | |
1997 | schema: | |
1998 | type: number | |
1999 | example: 262144 | |
2000 | required: true | |
2001 | description: | | |
2002 | Size of the chunk that the request is sending. | |
2003 | ||
2004 | 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) | |
2005 | doesn't mandate for chunks to have the same size throughout the upload sequence. | |
2006 | ||
2007 | Remember that larger chunks are more efficient. PeerTube's web client uses chunks varying from | |
2008 | 1048576 bytes (~1MB) and increases or reduces size depending on connection health. | |
2009 | requestBody: | |
2010 | content: | |
2011 | application/octet-stream: | |
2012 | schema: | |
2013 | type: string | |
2014 | format: binary | |
2015 | responses: | |
2016 | '200': | |
2017 | description: last chunk received | |
2018 | headers: | |
2019 | Content-Length: | |
2020 | schema: | |
2021 | type: number | |
2022 | content: | |
2023 | application/json: | |
2024 | schema: | |
2025 | $ref: '#/components/schemas/VideoUploadResponse' | |
2026 | '308': | |
2027 | description: resume incomplete | |
2028 | headers: | |
2029 | Range: | |
2030 | schema: | |
2031 | type: string | |
2032 | example: bytes=0-262143 | |
2033 | Content-Length: | |
2034 | schema: | |
2035 | type: number | |
2036 | example: 0 | |
2037 | '403': | |
2038 | description: video didn't pass upload filter | |
c756bae0 RK |
2039 | '404': |
2040 | description: upload not found | |
2041 | '409': | |
2042 | description: chunk doesn't match range | |
f6d6e7f8 | 2043 | '422': |
2044 | description: video unreadable | |
c756bae0 RK |
2045 | '429': |
2046 | description: too many concurrent requests | |
f6d6e7f8 | 2047 | delete: |
2048 | summary: Cancel the resumable upload of a video, deleting any data uploaded so far | |
2049 | description: Uses [a resumable protocol](https://github.com/kukhariev/node-uploadx/blob/master/proto.md) to cancel the upload of a video | |
40cfb36b | 2050 | operationId: uploadResumableCancel |
f6d6e7f8 | 2051 | security: |
2052 | - OAuth2: [] | |
2053 | tags: | |
2054 | - Video | |
2055 | - Video Upload | |
2056 | parameters: | |
2057 | - name: upload_id | |
c215e627 | 2058 | in: query |
f6d6e7f8 | 2059 | required: true |
2060 | description: | | |
2061 | Created session id to proceed with. If you didn't send chunks in the last 12 hours, it is | |
2062 | not valid anymore and the upload session has already been deleted with its data ;-) | |
2063 | schema: | |
2064 | type: string | |
2065 | - name: Content-Length | |
2066 | in: header | |
2067 | required: true | |
2068 | schema: | |
2069 | type: number | |
2070 | example: 0 | |
2071 | responses: | |
2072 | '204': | |
2073 | description: upload cancelled | |
2074 | headers: | |
2075 | Content-Length: | |
2076 | schema: | |
2077 | type: number | |
2078 | example: 0 | |
c756bae0 RK |
2079 | '404': |
2080 | description: upload not found | |
3f71c4c0 | 2081 | |
28c8e63e C |
2082 | /videos/imports: |
2083 | post: | |
b029d58a C |
2084 | summary: Import a video |
2085 | description: Import a torrent or magnetURI or HTTP resource (if enabled by the instance administrator) | |
40cfb36b | 2086 | operationId: importVideo |
28c8e63e C |
2087 | security: |
2088 | - OAuth2: [] | |
2089 | tags: | |
2090 | - Video | |
f6d6e7f8 | 2091 | - Video Upload |
28c8e63e C |
2092 | requestBody: |
2093 | content: | |
2094 | multipart/form-data: | |
2095 | schema: | |
ac2a5b54 | 2096 | $ref: '#/components/schemas/VideoCreateImport' |
0ad45af7 FS |
2097 | encoding: |
2098 | torrentfile: | |
2099 | contentType: application/x-bittorrent | |
2100 | thumbnailfile: | |
2101 | contentType: image/jpeg | |
2102 | previewfile: | |
2103 | contentType: image/jpeg | |
06746a8b RK |
2104 | responses: |
2105 | '200': | |
2106 | description: successful operation | |
2107 | content: | |
2108 | application/json: | |
2109 | schema: | |
2110 | $ref: '#/components/schemas/VideoUploadResponse' | |
06746a8b RK |
2111 | '400': |
2112 | description: '`magnetUri` or `targetUrl` or a torrent file missing' | |
f2eb23cd RK |
2113 | '403': |
2114 | description: video didn't pass pre-import filter | |
2115 | '409': | |
2116 | description: HTTP or Torrent/magnetURI import not enabled | |
668b7f09 | 2117 | |
4e239e35 C |
2118 | /videos/live: |
2119 | post: | |
2120 | summary: Create a live | |
e2adb8cb | 2121 | operationId: addLive |
4e239e35 C |
2122 | security: |
2123 | - OAuth2: [] | |
2124 | tags: | |
2125 | - Live Videos | |
2126 | - Video | |
2127 | responses: | |
2128 | '200': | |
2129 | description: successful operation | |
2130 | content: | |
2131 | application/json: | |
2132 | schema: | |
2133 | $ref: '#/components/schemas/VideoUploadResponse' | |
c756bae0 RK |
2134 | '400': |
2135 | x-summary: validation error, or conflicting `saveReplay` and `permanentLive` parameter set | |
2136 | description: | | |
2137 | Disambiguate via `type`: | |
2138 | - default type for a validation error | |
2139 | - `live_conflicting_permanent_and_save_replay` for conflicting parameters set | |
4e239e35 | 2140 | '403': |
c756bae0 RK |
2141 | x-summary: live is not enabled, allow replay is not enabled, or max instance/user live videos limit is exceeded |
2142 | description: | | |
2143 | Disambiguate via `type`: | |
2144 | - `live_not_enabled` for a disabled live feature | |
2145 | - `live_not_allowing_replay` for a disabled replay feature | |
2146 | - `max_instance_lives_limit_reached` for the absolute concurrent live limit | |
2147 | - `max_user_lives_limit_reached` for the user concurrent live limit | |
4e239e35 C |
2148 | requestBody: |
2149 | content: | |
2150 | multipart/form-data: | |
2151 | schema: | |
2152 | type: object | |
2153 | properties: | |
2154 | channelId: | |
2155 | description: Channel id that will contain this live video | |
2156 | type: integer | |
2157 | saveReplay: | |
2158 | type: boolean | |
bb4ba6d9 C |
2159 | permanentLive: |
2160 | description: User can stream multiple times in a permanent live | |
2161 | type: boolean | |
4e239e35 C |
2162 | thumbnailfile: |
2163 | description: Live video/replay thumbnail file | |
2164 | type: string | |
2165 | format: binary | |
2166 | previewfile: | |
2167 | description: Live video/replay preview file | |
2168 | type: string | |
2169 | format: binary | |
2170 | privacy: | |
2171 | $ref: '#/components/schemas/VideoPrivacySet' | |
2172 | category: | |
40cfb36b | 2173 | $ref: '#/components/schemas/VideoCategorySet' |
4e239e35 | 2174 | licence: |
40cfb36b | 2175 | $ref: '#/components/schemas/VideoLicenceSet' |
4e239e35 | 2176 | language: |
40cfb36b | 2177 | $ref: '#/components/schemas/VideoLanguageSet' |
4e239e35 C |
2178 | description: |
2179 | description: Live video/replay description | |
2180 | type: string | |
2181 | support: | |
2182 | description: A text tell the audience how to support the creator | |
9a320a06 | 2183 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4e239e35 C |
2184 | type: string |
2185 | nsfw: | |
2186 | description: Whether or not this live video/replay contains sensitive content | |
2187 | type: boolean | |
2188 | name: | |
2189 | description: Live video/replay name | |
2190 | type: string | |
bdac0584 RK |
2191 | minLength: 3 |
2192 | maxLength: 120 | |
4e239e35 C |
2193 | tags: |
2194 | description: Live video/replay tags (maximum 5 tags each between 2 and 30 characters) | |
2195 | type: array | |
2196 | minItems: 1 | |
2197 | maxItems: 5 | |
2198 | items: | |
2199 | type: string | |
2200 | minLength: 2 | |
2201 | maxLength: 30 | |
2202 | commentsEnabled: | |
2203 | description: Enable or disable comments for this live video/replay | |
2204 | type: boolean | |
2205 | downloadEnabled: | |
2206 | description: Enable or disable downloading for the replay of this live | |
2207 | type: boolean | |
2208 | required: | |
2209 | - channelId | |
2210 | - name | |
2211 | encoding: | |
2212 | thumbnailfile: | |
2213 | contentType: image/jpeg | |
2214 | previewfile: | |
2215 | contentType: image/jpeg | |
2216 | ||
2217 | /videos/live/{id}: | |
2218 | get: | |
f6d6e7f8 | 2219 | summary: Get information about a live |
40cfb36b | 2220 | operationId: getLiveId |
4e239e35 C |
2221 | security: |
2222 | - OAuth2: [] | |
2223 | tags: | |
2224 | - Live Videos | |
2225 | - Video | |
2226 | parameters: | |
2227 | - $ref: '#/components/parameters/idOrUUID' | |
2228 | responses: | |
2229 | '200': | |
2230 | description: successful operation | |
2231 | content: | |
2232 | application/json: | |
2233 | schema: | |
2234 | $ref: '#/components/schemas/LiveVideoResponse' | |
2235 | put: | |
f6d6e7f8 | 2236 | summary: Update information about a live |
40cfb36b | 2237 | operationId: updateLiveId |
4e239e35 C |
2238 | security: |
2239 | - OAuth2: [] | |
2240 | tags: | |
2241 | - Live Videos | |
2242 | - Video | |
2243 | parameters: | |
2244 | - $ref: '#/components/parameters/idOrUUID' | |
2245 | requestBody: | |
2246 | content: | |
2247 | application/json: | |
2248 | schema: | |
2249 | $ref: '#/components/schemas/LiveVideoUpdate' | |
2250 | responses: | |
2251 | '204': | |
b8375da9 | 2252 | description: successful operation |
4e239e35 | 2253 | '400': |
b8375da9 | 2254 | description: bad parameters or trying to update a live that has already started |
4e239e35 | 2255 | '403': |
b8375da9 | 2256 | description: trying to save replay of the live but saving replay is not enabled on the instance |
4e239e35 | 2257 | |
668b7f09 C |
2258 | /users/me/abuses: |
2259 | get: | |
2260 | summary: List my abuses | |
985ece57 | 2261 | operationId: getMyAbuses |
668b7f09 C |
2262 | security: |
2263 | - OAuth2: [] | |
2264 | tags: | |
2265 | - Abuses | |
2266 | - My User | |
2267 | parameters: | |
2268 | - name: id | |
2269 | in: query | |
2270 | description: only list the report with this id | |
2271 | schema: | |
2272 | type: integer | |
2273 | - name: state | |
2274 | in: query | |
2275 | schema: | |
2276 | $ref: '#/components/schemas/AbuseStateSet' | |
985ece57 | 2277 | - $ref: '#/components/parameters/abusesSort' |
668b7f09 C |
2278 | - $ref: '#/components/parameters/start' |
2279 | - $ref: '#/components/parameters/count' | |
668b7f09 C |
2280 | responses: |
2281 | '200': | |
2282 | description: successful operation | |
2283 | content: | |
2284 | application/json: | |
2285 | schema: | |
985ece57 RK |
2286 | type: object |
2287 | properties: | |
2288 | total: | |
2289 | type: integer | |
2290 | example: 1 | |
2291 | data: | |
2292 | type: array | |
2293 | items: | |
2294 | $ref: '#/components/schemas/Abuse' | |
668b7f09 | 2295 | |
e3489df9 | 2296 | /abuses: |
1569a818 | 2297 | get: |
310b5219 | 2298 | summary: List abuses |
985ece57 | 2299 | operationId: getAbuses |
94ff4c23 | 2300 | security: |
b029d58a | 2301 | - OAuth2: |
06746a8b RK |
2302 | - admin |
2303 | - moderator | |
1569a818 | 2304 | tags: |
310b5219 | 2305 | - Abuses |
44cb3b85 | 2306 | parameters: |
84f6e32c RK |
2307 | - name: id |
2308 | in: query | |
2309 | description: only list the report with this id | |
2310 | schema: | |
2311 | type: integer | |
2312 | - name: predefinedReason | |
2313 | in: query | |
2314 | description: predefined reason the listed reports should contain | |
2315 | schema: | |
e3489df9 | 2316 | $ref: '#/components/schemas/PredefinedAbuseReasons' |
84f6e32c RK |
2317 | - name: search |
2318 | in: query | |
2319 | description: plain search that will match with video titles, reporter names and more | |
2320 | schema: | |
2321 | type: string | |
2322 | - name: state | |
2323 | in: query | |
84f6e32c | 2324 | schema: |
668b7f09 | 2325 | $ref: '#/components/schemas/AbuseStateSet' |
84f6e32c RK |
2326 | - name: searchReporter |
2327 | in: query | |
2328 | description: only list reports of a specific reporter | |
2329 | schema: | |
2330 | type: string | |
2331 | - name: searchReportee | |
2332 | description: only list reports of a specific reportee | |
2333 | in: query | |
2334 | schema: | |
2335 | type: string | |
2336 | - name: searchVideo | |
2337 | in: query | |
2338 | description: only list reports of a specific video | |
2339 | schema: | |
2340 | type: string | |
2341 | - name: searchVideoChannel | |
2342 | in: query | |
2343 | description: only list reports of a specific video channel | |
2344 | schema: | |
2345 | type: string | |
17b07dc5 C |
2346 | - name: videoIs |
2347 | in: query | |
c756bae0 | 2348 | description: only list deleted or blocklisted videos |
17b07dc5 C |
2349 | schema: |
2350 | type: string | |
2351 | enum: | |
2352 | - 'deleted' | |
2353 | - 'blacklisted' | |
2354 | - name: filter | |
2355 | in: query | |
2356 | description: only list account, comment or video reports | |
2357 | schema: | |
2358 | type: string | |
2359 | enum: | |
2360 | - 'video' | |
2361 | - 'comment' | |
2362 | - 'account' | |
3e9e6f2f RK |
2363 | - $ref: '#/components/parameters/start' |
2364 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 2365 | - $ref: '#/components/parameters/abusesSort' |
1569a818 DG |
2366 | responses: |
2367 | '200': | |
2368 | description: successful operation | |
3e9e6f2f RK |
2369 | content: |
2370 | application/json: | |
2371 | schema: | |
985ece57 RK |
2372 | type: object |
2373 | properties: | |
2374 | total: | |
2375 | type: integer | |
2376 | example: 1 | |
2377 | data: | |
2378 | type: array | |
2379 | items: | |
2380 | $ref: '#/components/schemas/Abuse' | |
1569a818 | 2381 | post: |
b029d58a | 2382 | summary: Report an abuse |
94ff4c23 | 2383 | security: |
3e9e6f2f | 2384 | - OAuth2: [] |
1569a818 | 2385 | tags: |
310b5219 | 2386 | - Abuses |
50e16ccf | 2387 | requestBody: |
1ebddadd | 2388 | required: true |
50e16ccf C |
2389 | content: |
2390 | application/json: | |
2391 | schema: | |
2392 | type: object | |
2393 | properties: | |
2394 | reason: | |
2395 | description: Reason why the user reports this video | |
2396 | type: string | |
4302058c RK |
2397 | minLength: 2 |
2398 | maxLength: 3000 | |
1ebddadd | 2399 | predefinedReasons: |
e3489df9 | 2400 | $ref: '#/components/schemas/PredefinedAbuseReasons' |
e3489df9 C |
2401 | video: |
2402 | type: object | |
2403 | properties: | |
2404 | id: | |
2405 | description: Video id to report | |
b8375da9 RK |
2406 | allOf: |
2407 | - $ref: '#/components/schemas/Video/properties/id' | |
e3489df9 C |
2408 | startAt: |
2409 | type: integer | |
c00100b6 | 2410 | format: seconds |
e3489df9 C |
2411 | description: Timestamp in the video that marks the beginning of the report |
2412 | minimum: 0 | |
2413 | endAt: | |
2414 | type: integer | |
c00100b6 | 2415 | format: seconds |
e3489df9 C |
2416 | description: Timestamp in the video that marks the ending of the report |
2417 | minimum: 0 | |
2418 | comment: | |
2419 | type: object | |
2420 | properties: | |
2421 | id: | |
2422 | description: Comment id to report | |
b8375da9 RK |
2423 | allOf: |
2424 | - $ref: '#/components/schemas/VideoComment/properties/id' | |
e3489df9 C |
2425 | account: |
2426 | type: object | |
2427 | properties: | |
2428 | id: | |
2429 | description: Account id to report | |
b8375da9 | 2430 | type: integer |
1ebddadd RK |
2431 | required: |
2432 | - reason | |
50e16ccf | 2433 | responses: |
65cb01a2 | 2434 | '200': |
50e16ccf | 2435 | description: successful operation |
65cb01a2 RK |
2436 | content: |
2437 | application/json: | |
2438 | schema: | |
2439 | type: object | |
2440 | properties: | |
2441 | abuse: | |
2442 | type: object | |
2443 | properties: | |
2444 | id: | |
2445 | $ref: '#/components/schemas/id' | |
84f6e32c RK |
2446 | '400': |
2447 | description: incorrect request parameters | |
3f71c4c0 | 2448 | |
e3489df9 | 2449 | '/abuses/{abuseId}': |
50e16ccf C |
2450 | put: |
2451 | summary: Update an abuse | |
2452 | security: | |
2453 | - OAuth2: | |
2454 | - admin | |
2455 | - moderator | |
2456 | tags: | |
310b5219 | 2457 | - Abuses |
50e16ccf | 2458 | parameters: |
50e16ccf C |
2459 | - $ref: '#/components/parameters/abuseId' |
2460 | requestBody: | |
2461 | content: | |
2462 | application/json: | |
2463 | schema: | |
2464 | type: object | |
2465 | properties: | |
2466 | state: | |
4f32032f | 2467 | $ref: '#/components/schemas/AbuseStateSet' |
50e16ccf C |
2468 | moderationComment: |
2469 | type: string | |
84f6e32c | 2470 | description: Update the report comment visible only to the moderation team |
4302058c RK |
2471 | minLength: 2 |
2472 | maxLength: 3000 | |
84f6e32c RK |
2473 | responses: |
2474 | '204': | |
2475 | description: successful operation | |
2476 | '404': | |
310b5219 | 2477 | description: abuse not found |
50e16ccf | 2478 | delete: |
84f6e32c | 2479 | tags: |
310b5219 | 2480 | - Abuses |
50e16ccf C |
2481 | summary: Delete an abuse |
2482 | security: | |
2483 | - OAuth2: | |
64b5c247 RK |
2484 | - admin |
2485 | - moderator | |
84f6e32c | 2486 | parameters: |
84f6e32c | 2487 | - $ref: '#/components/parameters/abuseId' |
50e16ccf C |
2488 | responses: |
2489 | '204': | |
2490 | description: successful operation | |
06746a8b RK |
2491 | '404': |
2492 | description: block not found | |
3f71c4c0 | 2493 | |
668b7f09 C |
2494 | '/abuses/{abuseId}/messages': |
2495 | get: | |
2496 | summary: List messages of an abuse | |
2497 | security: | |
2498 | - OAuth2: [] | |
2499 | tags: | |
2500 | - Abuses | |
2501 | parameters: | |
2502 | - $ref: '#/components/parameters/abuseId' | |
2503 | responses: | |
2504 | '200': | |
2505 | description: successful operation | |
2506 | content: | |
2507 | application/json: | |
2508 | schema: | |
c76ecc3f RK |
2509 | type: object |
2510 | properties: | |
2511 | total: | |
2512 | type: integer | |
2513 | example: 1 | |
2514 | data: | |
2515 | type: array | |
2516 | items: | |
2517 | $ref: '#/components/schemas/AbuseMessage' | |
668b7f09 C |
2518 | post: |
2519 | summary: Add message to an abuse | |
2520 | security: | |
2521 | - OAuth2: [] | |
2522 | tags: | |
2523 | - Abuses | |
fcc4466e C |
2524 | parameters: |
2525 | - $ref: '#/components/parameters/abuseId' | |
668b7f09 C |
2526 | requestBody: |
2527 | required: true | |
2528 | content: | |
2529 | application/json: | |
2530 | schema: | |
2531 | type: object | |
2532 | properties: | |
2533 | message: | |
2534 | description: Message to send | |
2535 | type: string | |
4302058c RK |
2536 | minLength: 2 |
2537 | maxLength: 3000 | |
668b7f09 C |
2538 | required: |
2539 | - message | |
2540 | responses: | |
2541 | '200': | |
2542 | description: successful operation | |
2543 | '400': | |
2544 | description: incorrect request parameters | |
3f71c4c0 | 2545 | |
668b7f09 C |
2546 | '/abuses/{abuseId}/messages/{abuseMessageId}': |
2547 | delete: | |
2548 | summary: Delete an abuse message | |
2549 | security: | |
2550 | - OAuth2: [] | |
2551 | tags: | |
2552 | - Abuses | |
2553 | parameters: | |
2554 | - $ref: '#/components/parameters/abuseId' | |
2555 | - $ref: '#/components/parameters/abuseMessageId' | |
2556 | responses: | |
2557 | '204': | |
2558 | description: successful operation | |
50e16ccf | 2559 | |
3e9e6f2f | 2560 | '/videos/{id}/blacklist': |
1569a818 | 2561 | post: |
06746a8b | 2562 | summary: Block a video |
3f71c4c0 | 2563 | operationId: addVideoBlock |
94ff4c23 | 2564 | security: |
3e9e6f2f | 2565 | - OAuth2: |
64b5c247 RK |
2566 | - admin |
2567 | - moderator | |
1569a818 | 2568 | tags: |
06746a8b | 2569 | - Video Blocks |
1569a818 | 2570 | parameters: |
cb9d028a | 2571 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
2572 | responses: |
2573 | '204': | |
c1843150 | 2574 | description: successful operation |
1569a818 | 2575 | delete: |
06746a8b | 2576 | summary: Unblock a video by its id |
3f71c4c0 | 2577 | operationId: delVideoBlock |
94ff4c23 | 2578 | security: |
3e9e6f2f | 2579 | - OAuth2: |
64b5c247 RK |
2580 | - admin |
2581 | - moderator | |
1569a818 | 2582 | tags: |
06746a8b | 2583 | - Video Blocks |
1569a818 | 2584 | parameters: |
cb9d028a | 2585 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
2586 | responses: |
2587 | '204': | |
c1843150 | 2588 | description: successful operation |
06746a8b RK |
2589 | '404': |
2590 | description: block not found | |
3f71c4c0 | 2591 | |
c360c494 | 2592 | /videos/blacklist: |
1569a818 | 2593 | get: |
06746a8b RK |
2594 | tags: |
2595 | - Video Blocks | |
f4d59981 | 2596 | summary: List video blocks |
3f71c4c0 | 2597 | operationId: getVideoBlocks |
94ff4c23 | 2598 | security: |
3e9e6f2f | 2599 | - OAuth2: |
64b5c247 RK |
2600 | - admin |
2601 | - moderator | |
44cb3b85 | 2602 | parameters: |
84f6e32c RK |
2603 | - name: type |
2604 | in: query | |
2605 | description: > | |
2606 | list only blocks that match this type: | |
2607 | ||
2608 | - `1`: manual block | |
2609 | ||
2610 | - `2`: automatic block that needs review | |
2611 | schema: | |
2612 | type: integer | |
2613 | enum: | |
2614 | - 1 | |
2615 | - 2 | |
2616 | - name: search | |
2617 | in: query | |
2618 | description: plain search that will match with video titles, and more | |
2619 | schema: | |
2620 | type: string | |
3e9e6f2f RK |
2621 | - $ref: '#/components/parameters/start' |
2622 | - $ref: '#/components/parameters/count' | |
fd5af7a2 | 2623 | - $ref: '#/components/parameters/blacklistsSort' |
1569a818 DG |
2624 | responses: |
2625 | '200': | |
2626 | description: successful operation | |
3e9e6f2f RK |
2627 | content: |
2628 | application/json: | |
2629 | schema: | |
84f6e32c RK |
2630 | type: object |
2631 | properties: | |
2632 | total: | |
2633 | type: integer | |
2634 | example: 1 | |
2635 | data: | |
2636 | type: array | |
2637 | items: | |
2638 | $ref: '#/components/schemas/VideoBlacklist' | |
3f71c4c0 | 2639 | |
67ae04a5 C |
2640 | /videos/{id}/captions: |
2641 | get: | |
b029d58a | 2642 | summary: List captions of a video |
3f71c4c0 | 2643 | operationId: getVideoCaptions |
67ae04a5 | 2644 | tags: |
04b703f6 | 2645 | - Video Captions |
67ae04a5 | 2646 | parameters: |
cb9d028a | 2647 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
2648 | responses: |
2649 | '200': | |
2650 | description: successful operation | |
2651 | content: | |
2652 | application/json: | |
2653 | schema: | |
2654 | type: object | |
2655 | properties: | |
2656 | total: | |
2657 | type: integer | |
84f6e32c | 2658 | example: 1 |
67ae04a5 C |
2659 | data: |
2660 | type: array | |
2661 | items: | |
2662 | $ref: '#/components/schemas/VideoCaption' | |
3f71c4c0 | 2663 | |
67ae04a5 C |
2664 | /videos/{id}/captions/{captionLanguage}: |
2665 | put: | |
2666 | summary: Add or replace a video caption | |
3f71c4c0 | 2667 | operationId: addVideoCaption |
64b5c247 RK |
2668 | security: |
2669 | - OAuth2: | |
2670 | - user | |
67ae04a5 | 2671 | tags: |
04b703f6 | 2672 | - Video Captions |
67ae04a5 | 2673 | parameters: |
cb9d028a | 2674 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
2675 | - $ref: '#/components/parameters/captionLanguage' |
2676 | requestBody: | |
2677 | content: | |
2678 | multipart/form-data: | |
2679 | schema: | |
2680 | type: object | |
2681 | properties: | |
2682 | captionfile: | |
2683 | description: The file to upload. | |
2684 | type: string | |
2685 | format: binary | |
0ad45af7 FS |
2686 | encoding: |
2687 | captionfile: | |
205ed5b7 | 2688 | contentType: text/vtt, application/x-subrip, text/plain |
67ae04a5 C |
2689 | responses: |
2690 | '204': | |
c1843150 | 2691 | description: successful operation |
06746a8b RK |
2692 | '404': |
2693 | description: video or language not found | |
67ae04a5 C |
2694 | delete: |
2695 | summary: Delete a video caption | |
3f71c4c0 | 2696 | operationId: delVideoCaption |
64b5c247 RK |
2697 | security: |
2698 | - OAuth2: | |
2699 | - user | |
67ae04a5 | 2700 | tags: |
04b703f6 | 2701 | - Video Captions |
67ae04a5 | 2702 | parameters: |
cb9d028a | 2703 | - $ref: '#/components/parameters/idOrUUID' |
67ae04a5 C |
2704 | - $ref: '#/components/parameters/captionLanguage' |
2705 | responses: | |
2706 | '204': | |
c1843150 | 2707 | description: successful operation |
06746a8b RK |
2708 | '404': |
2709 | description: video or language or caption for that language not found | |
3f71c4c0 | 2710 | |
48dce1c9 | 2711 | /video-channels: |
1569a818 | 2712 | get: |
b029d58a | 2713 | summary: List video channels |
9a320a06 | 2714 | operationId: getVideoChannels |
1569a818 | 2715 | tags: |
b029d58a | 2716 | - Video Channels |
44cb3b85 | 2717 | parameters: |
3e9e6f2f RK |
2718 | - $ref: '#/components/parameters/start' |
2719 | - $ref: '#/components/parameters/count' | |
2720 | - $ref: '#/components/parameters/sort' | |
1569a818 DG |
2721 | responses: |
2722 | '200': | |
2723 | description: successful operation | |
3e9e6f2f RK |
2724 | content: |
2725 | application/json: | |
2726 | schema: | |
045bcd0d | 2727 | $ref: '#/components/schemas/VideoChannelList' |
1569a818 | 2728 | post: |
b029d58a | 2729 | summary: Create a video channel |
3f71c4c0 | 2730 | operationId: addVideoChannel |
94ff4c23 | 2731 | security: |
3e9e6f2f | 2732 | - OAuth2: [] |
1569a818 | 2733 | tags: |
b029d58a | 2734 | - Video Channels |
1569a818 DG |
2735 | responses: |
2736 | '204': | |
c1843150 | 2737 | description: successful operation |
9a320a06 RK |
2738 | content: |
2739 | application/json: | |
2740 | schema: | |
2741 | type: object | |
2742 | properties: | |
2743 | videoChannel: | |
2744 | type: object | |
2745 | properties: | |
2746 | id: | |
2747 | $ref: '#/components/schemas/VideoChannel/properties/id' | |
3e9e6f2f | 2748 | requestBody: |
7d14d4d2 C |
2749 | content: |
2750 | application/json: | |
2751 | schema: | |
2752 | $ref: '#/components/schemas/VideoChannelCreate' | |
3f71c4c0 | 2753 | |
9ce3d302 | 2754 | '/video-channels/{channelHandle}': |
1569a818 | 2755 | get: |
b029d58a | 2756 | summary: Get a video channel |
9a320a06 | 2757 | operationId: getVideoChannel |
1569a818 | 2758 | tags: |
b029d58a | 2759 | - Video Channels |
1569a818 | 2760 | parameters: |
9ce3d302 | 2761 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
2762 | responses: |
2763 | '200': | |
2764 | description: successful operation | |
3e9e6f2f RK |
2765 | content: |
2766 | application/json: | |
2767 | schema: | |
2768 | $ref: '#/components/schemas/VideoChannel' | |
1569a818 | 2769 | put: |
b029d58a | 2770 | summary: Update a video channel |
3f71c4c0 | 2771 | operationId: putVideoChannel |
94ff4c23 | 2772 | security: |
3e9e6f2f | 2773 | - OAuth2: [] |
1569a818 | 2774 | tags: |
b029d58a | 2775 | - Video Channels |
1569a818 | 2776 | parameters: |
9ce3d302 | 2777 | - $ref: '#/components/parameters/channelHandle' |
1569a818 DG |
2778 | responses: |
2779 | '204': | |
c1843150 | 2780 | description: successful operation |
3e9e6f2f | 2781 | requestBody: |
7d14d4d2 C |
2782 | content: |
2783 | application/json: | |
2784 | schema: | |
2785 | $ref: '#/components/schemas/VideoChannelUpdate' | |
1569a818 | 2786 | delete: |
b029d58a | 2787 | summary: Delete a video channel |
3f71c4c0 | 2788 | operationId: delVideoChannel |
94ff4c23 | 2789 | security: |
3e9e6f2f | 2790 | - OAuth2: [] |
1569a818 | 2791 | tags: |
b029d58a | 2792 | - Video Channels |
1569a818 | 2793 | parameters: |
9ce3d302 | 2794 | - $ref: '#/components/parameters/channelHandle' |
cc918ac3 C |
2795 | responses: |
2796 | '204': | |
c1843150 | 2797 | description: successful operation |
3f71c4c0 | 2798 | |
9ce3d302 | 2799 | '/video-channels/{channelHandle}/videos': |
cc918ac3 | 2800 | get: |
b029d58a | 2801 | summary: List videos of a video channel |
3f71c4c0 | 2802 | operationId: getVideoChannelVideos |
cc918ac3 | 2803 | tags: |
048b6946 | 2804 | - Video |
b029d58a | 2805 | - Video Channels |
cc918ac3 | 2806 | parameters: |
9ce3d302 | 2807 | - $ref: '#/components/parameters/channelHandle' |
59c794a5 | 2808 | - $ref: '#/components/parameters/categoryOneOf' |
1fd61899 | 2809 | - $ref: '#/components/parameters/isLive' |
59c794a5 C |
2810 | - $ref: '#/components/parameters/tagsOneOf' |
2811 | - $ref: '#/components/parameters/tagsAllOf' | |
2812 | - $ref: '#/components/parameters/licenceOneOf' | |
2813 | - $ref: '#/components/parameters/languageOneOf' | |
2814 | - $ref: '#/components/parameters/nsfw' | |
2815 | - $ref: '#/components/parameters/filter' | |
2816 | - $ref: '#/components/parameters/skipCount' | |
2817 | - $ref: '#/components/parameters/start' | |
2818 | - $ref: '#/components/parameters/count' | |
2819 | - $ref: '#/components/parameters/videosSort' | |
1569a818 | 2820 | responses: |
cc918ac3 | 2821 | '200': |
1569a818 | 2822 | description: successful operation |
3e9e6f2f RK |
2823 | content: |
2824 | application/json: | |
2825 | schema: | |
048b6946 | 2826 | $ref: '#/components/schemas/VideoListResponse' |
3f71c4c0 | 2827 | |
75cba40d C |
2828 | '/video-channels/{channelHandle}/avatar/pick': |
2829 | post: | |
2830 | summary: Update channel avatar | |
2831 | security: | |
2832 | - OAuth2: [] | |
2833 | tags: | |
2834 | - Video Channels | |
2835 | parameters: | |
2836 | - $ref: '#/components/parameters/channelHandle' | |
2837 | responses: | |
2838 | '200': | |
2839 | description: successful operation | |
2840 | content: | |
2841 | application/json: | |
2842 | schema: | |
2843 | type: object | |
2844 | properties: | |
2845 | avatar: | |
2846 | $ref: '#/components/schemas/ActorImage' | |
2847 | '413': | |
2848 | description: image file too large | |
2849 | headers: | |
2850 | X-File-Maximum-Size: | |
2851 | schema: | |
2852 | type: string | |
2853 | format: Nginx size | |
2854 | description: Maximum file size for the avatar | |
2855 | requestBody: | |
2856 | content: | |
2857 | multipart/form-data: | |
2858 | schema: | |
2859 | type: object | |
2860 | properties: | |
2861 | avatarfile: | |
2862 | description: The file to upload. | |
2863 | type: string | |
2864 | format: binary | |
2865 | encoding: | |
2866 | avatarfile: | |
2867 | contentType: image/png, image/jpeg | |
3f71c4c0 | 2868 | |
75cba40d C |
2869 | '/video-channels/{channelHandle}/avatar': |
2870 | delete: | |
2871 | summary: Delete channel avatar | |
2872 | security: | |
2873 | - OAuth2: [] | |
2874 | tags: | |
2875 | - Video Channels | |
2876 | parameters: | |
2877 | - $ref: '#/components/parameters/channelHandle' | |
2878 | responses: | |
2879 | '204': | |
2880 | description: successful operation | |
2881 | ||
75cba40d C |
2882 | '/video-channels/{channelHandle}/banner/pick': |
2883 | post: | |
2884 | summary: Update channel banner | |
2885 | security: | |
2886 | - OAuth2: [] | |
2887 | tags: | |
2888 | - Video Channels | |
2889 | parameters: | |
2890 | - $ref: '#/components/parameters/channelHandle' | |
2891 | responses: | |
2892 | '200': | |
2893 | description: successful operation | |
2894 | content: | |
2895 | application/json: | |
2896 | schema: | |
2897 | type: object | |
2898 | properties: | |
2899 | banner: | |
2900 | $ref: '#/components/schemas/ActorImage' | |
2901 | '413': | |
2902 | description: image file too large | |
2903 | headers: | |
2904 | X-File-Maximum-Size: | |
2905 | schema: | |
2906 | type: string | |
2907 | format: Nginx size | |
2908 | description: Maximum file size for the banner | |
2909 | requestBody: | |
2910 | content: | |
2911 | multipart/form-data: | |
2912 | schema: | |
2913 | type: object | |
2914 | properties: | |
2915 | bannerfile: | |
2916 | description: The file to upload. | |
2917 | type: string | |
2918 | format: binary | |
2919 | encoding: | |
2920 | bannerfile: | |
2921 | contentType: image/png, image/jpeg | |
3f71c4c0 | 2922 | |
75cba40d C |
2923 | '/video-channels/{channelHandle}/banner': |
2924 | delete: | |
2925 | summary: Delete channel banner | |
2926 | security: | |
2927 | - OAuth2: [] | |
2928 | tags: | |
2929 | - Video Channels | |
2930 | parameters: | |
2931 | - $ref: '#/components/parameters/channelHandle' | |
2932 | responses: | |
2933 | '204': | |
2934 | description: successful operation | |
c1843150 C |
2935 | |
2936 | /video-playlists/privacies: | |
2937 | get: | |
40cfb36b RK |
2938 | summary: List available playlist privacy policies |
2939 | operationId: getPlaylistPrivacyPolicies | |
c1843150 C |
2940 | tags: |
2941 | - Video Playlists | |
2942 | responses: | |
2943 | '200': | |
2944 | description: successful operation | |
2945 | content: | |
2946 | application/json: | |
2947 | schema: | |
2948 | type: array | |
2949 | items: | |
2950 | type: string | |
84f6e32c RK |
2951 | examples: |
2952 | nightly: | |
2953 | externalValue: https://peertube2.cpy.re/api/v1/video-playlists/privacies | |
c1843150 | 2954 | |
71810d0b RK |
2955 | /video-playlists: |
2956 | get: | |
b029d58a | 2957 | summary: List video playlists |
40cfb36b | 2958 | operationId: getPlaylists |
71810d0b | 2959 | tags: |
b029d58a | 2960 | - Video Playlists |
71810d0b RK |
2961 | parameters: |
2962 | - $ref: '#/components/parameters/start' | |
2963 | - $ref: '#/components/parameters/count' | |
2964 | - $ref: '#/components/parameters/sort' | |
2965 | responses: | |
2966 | '200': | |
2967 | description: successful operation | |
2968 | content: | |
2969 | application/json: | |
2970 | schema: | |
84f6e32c RK |
2971 | type: object |
2972 | properties: | |
2973 | total: | |
2974 | type: integer | |
2975 | example: 1 | |
2976 | data: | |
2977 | type: array | |
2978 | items: | |
2979 | $ref: '#/components/schemas/VideoPlaylist' | |
c1843150 C |
2980 | post: |
2981 | summary: Create a video playlist | |
b8375da9 | 2982 | description: If the video playlist is set as public, `videoChannelId` is mandatory. |
e2adb8cb | 2983 | operationId: addPlaylist |
c1843150 C |
2984 | security: |
2985 | - OAuth2: [] | |
2986 | tags: | |
2987 | - Video Playlists | |
2988 | responses: | |
2989 | '200': | |
2990 | description: successful operation | |
2991 | content: | |
2992 | application/json: | |
2993 | schema: | |
2994 | type: object | |
2995 | properties: | |
2996 | videoPlaylist: | |
2997 | type: object | |
2998 | properties: | |
2999 | id: | |
b8375da9 | 3000 | $ref: '#/components/schemas/VideoPlaylist/properties/id' |
c1843150 | 3001 | uuid: |
b8375da9 | 3002 | $ref: '#/components/schemas/VideoPlaylist/properties/uuid' |
c1843150 C |
3003 | requestBody: |
3004 | content: | |
3005 | multipart/form-data: | |
3006 | schema: | |
3007 | type: object | |
3008 | properties: | |
3009 | displayName: | |
3010 | description: Video playlist display name | |
3011 | type: string | |
bdac0584 RK |
3012 | minLength: 1 |
3013 | maxLength: 120 | |
c1843150 C |
3014 | thumbnailfile: |
3015 | description: Video playlist thumbnail file | |
3016 | type: string | |
3017 | format: binary | |
3018 | privacy: | |
3019 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
3020 | description: | |
3021 | description: Video playlist description | |
3022 | type: string | |
b8375da9 RK |
3023 | minLength: 3 |
3024 | maxLength: 1000 | |
c1843150 | 3025 | videoChannelId: |
b8375da9 RK |
3026 | allOf: |
3027 | - $ref: '#/components/schemas/id' | |
c1843150 | 3028 | description: Video channel in which the playlist will be published |
c1843150 C |
3029 | required: |
3030 | - displayName | |
2c318664 RK |
3031 | encoding: |
3032 | thumbnailfile: | |
3033 | contentType: image/jpeg | |
c1843150 | 3034 | |
c00100b6 | 3035 | /video-playlists/{playlistId}: |
c1843150 C |
3036 | get: |
3037 | summary: Get a video playlist | |
3038 | tags: | |
3039 | - Video Playlists | |
3040 | parameters: | |
c00100b6 | 3041 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3042 | responses: |
3043 | '200': | |
3044 | description: successful operation | |
3045 | content: | |
3046 | application/json: | |
3047 | schema: | |
3048 | $ref: '#/components/schemas/VideoPlaylist' | |
3049 | put: | |
3050 | summary: Update a video playlist | |
3051 | description: 'If the video playlist is set as public, the playlist must have a assigned channel.' | |
3052 | security: | |
3053 | - OAuth2: [] | |
3054 | tags: | |
3055 | - Video Playlists | |
3056 | responses: | |
3057 | '204': | |
3058 | description: successful operation | |
3059 | parameters: | |
c00100b6 | 3060 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3061 | requestBody: |
3062 | content: | |
3063 | multipart/form-data: | |
3064 | schema: | |
3065 | type: object | |
3066 | properties: | |
3067 | displayName: | |
3068 | description: Video playlist display name | |
3069 | type: string | |
bdac0584 RK |
3070 | minLength: 1 |
3071 | maxLength: 120 | |
c1843150 C |
3072 | thumbnailfile: |
3073 | description: Video playlist thumbnail file | |
3074 | type: string | |
3075 | format: binary | |
3076 | privacy: | |
3077 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
3078 | description: | |
3079 | description: Video playlist description | |
3080 | type: string | |
3081 | videoChannelId: | |
b8375da9 RK |
3082 | allOf: |
3083 | - $ref: '#/components/schemas/id' | |
c1843150 | 3084 | description: Video channel in which the playlist will be published |
2c318664 RK |
3085 | encoding: |
3086 | thumbnailfile: | |
3087 | contentType: image/jpeg | |
c1843150 C |
3088 | delete: |
3089 | summary: Delete a video playlist | |
3090 | security: | |
3091 | - OAuth2: [] | |
3092 | tags: | |
3093 | - Video Playlists | |
3094 | parameters: | |
c00100b6 | 3095 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3096 | responses: |
3097 | '204': | |
3098 | description: successful operation | |
3099 | ||
c00100b6 | 3100 | /video-playlists/{playlistId}/videos: |
c1843150 C |
3101 | get: |
3102 | summary: 'List videos of a playlist' | |
e2adb8cb | 3103 | operationId: getVideoPlaylistVideos |
c1843150 C |
3104 | tags: |
3105 | - Videos | |
3106 | - Video Playlists | |
3107 | parameters: | |
c00100b6 | 3108 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3109 | responses: |
3110 | '200': | |
3111 | description: successful operation | |
3112 | content: | |
3113 | application/json: | |
3114 | schema: | |
3115 | $ref: '#/components/schemas/VideoListResponse' | |
3116 | post: | |
c00100b6 | 3117 | summary: Add a video in a playlist |
e2adb8cb | 3118 | operationId: addVideoPlaylistVideo |
c1843150 C |
3119 | security: |
3120 | - OAuth2: [] | |
3121 | tags: | |
3122 | - Videos | |
3123 | - Video Playlists | |
3124 | parameters: | |
c00100b6 | 3125 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3126 | responses: |
3127 | '200': | |
3128 | description: successful operation | |
3129 | content: | |
3130 | application/json: | |
3131 | schema: | |
3132 | type: object | |
3133 | properties: | |
3134 | videoPlaylistElement: | |
3135 | type: object | |
3136 | properties: | |
3137 | id: | |
06746a8b | 3138 | type: integer |
c00100b6 | 3139 | example: 2 |
c1843150 C |
3140 | requestBody: |
3141 | content: | |
3142 | application/json: | |
3143 | schema: | |
3144 | type: object | |
3145 | properties: | |
3146 | videoId: | |
c00100b6 RK |
3147 | oneOf: |
3148 | - $ref: '#/components/schemas/Video/properties/uuid' | |
b8375da9 RK |
3149 | - $ref: '#/components/schemas/Video/properties/id' |
3150 | description: Video to add in the playlist | |
c1843150 | 3151 | startTimestamp: |
06746a8b | 3152 | type: integer |
c00100b6 RK |
3153 | format: seconds |
3154 | description: Start the video at this specific timestamp | |
c1843150 | 3155 | stopTimestamp: |
06746a8b | 3156 | type: integer |
c00100b6 RK |
3157 | format: seconds |
3158 | description: Stop the video at this specific timestamp | |
c1843150 C |
3159 | required: |
3160 | - videoId | |
3161 | ||
c00100b6 | 3162 | /video-playlists/{playlistId}/videos/reorder: |
c1843150 C |
3163 | post: |
3164 | summary: 'Reorder a playlist' | |
e2adb8cb | 3165 | operationId: reorderVideoPlaylist |
c1843150 C |
3166 | security: |
3167 | - OAuth2: [] | |
3168 | tags: | |
3169 | - Video Playlists | |
3170 | parameters: | |
c00100b6 | 3171 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3172 | responses: |
3173 | '204': | |
3174 | description: successful operation | |
3175 | requestBody: | |
3176 | content: | |
3177 | application/json: | |
3178 | schema: | |
3179 | type: object | |
3180 | properties: | |
3181 | startPosition: | |
06746a8b RK |
3182 | type: integer |
3183 | description: 'Start position of the element to reorder' | |
3184 | minimum: 1 | |
c1843150 | 3185 | insertAfterPosition: |
06746a8b RK |
3186 | type: integer |
3187 | description: 'New position for the block to reorder, to add the block before the first element' | |
3188 | minimum: 0 | |
c1843150 | 3189 | reorderLength: |
06746a8b RK |
3190 | type: integer |
3191 | description: 'How many element from `startPosition` to reorder' | |
3192 | minimum: 1 | |
c1843150 C |
3193 | required: |
3194 | - startPosition | |
3195 | - insertAfterPosition | |
3196 | ||
c00100b6 | 3197 | /video-playlists/{playlistId}/videos/{playlistElementId}: |
c1843150 | 3198 | put: |
c00100b6 | 3199 | summary: Update a playlist element |
e2adb8cb | 3200 | operationId: putVideoPlaylistVideo |
c1843150 C |
3201 | security: |
3202 | - OAuth2: [] | |
3203 | tags: | |
3204 | - Video Playlists | |
3205 | parameters: | |
c00100b6 | 3206 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3207 | - $ref: '#/components/parameters/playlistElementId' |
3208 | responses: | |
3209 | '204': | |
3210 | description: successful operation | |
3211 | requestBody: | |
3212 | content: | |
3213 | application/json: | |
3214 | schema: | |
3215 | type: object | |
3216 | properties: | |
3217 | startTimestamp: | |
06746a8b | 3218 | type: integer |
c00100b6 RK |
3219 | format: seconds |
3220 | description: Start the video at this specific timestamp | |
c1843150 | 3221 | stopTimestamp: |
06746a8b | 3222 | type: integer |
c00100b6 RK |
3223 | format: seconds |
3224 | description: Stop the video at this specific timestamp | |
c1843150 | 3225 | delete: |
c00100b6 | 3226 | summary: Delete an element from a playlist |
e2adb8cb | 3227 | operationId: delVideoPlaylistVideo |
c1843150 C |
3228 | security: |
3229 | - OAuth2: [] | |
3230 | tags: | |
3231 | - Video Playlists | |
3232 | parameters: | |
c00100b6 | 3233 | - $ref: '#/components/parameters/playlistId' |
c1843150 C |
3234 | - $ref: '#/components/parameters/playlistElementId' |
3235 | responses: | |
3236 | '204': | |
3237 | description: successful operation | |
3238 | ||
0590bb46 C |
3239 | '/users/me/video-playlists/videos-exist': |
3240 | get: | |
c00100b6 | 3241 | summary: Check video exists in my playlists |
0590bb46 C |
3242 | security: |
3243 | - OAuth2: [] | |
3244 | tags: | |
3245 | - Video Playlists | |
3246 | parameters: | |
3247 | - name: videoIds | |
3248 | in: query | |
3249 | required: true | |
3250 | description: The video ids to check | |
3251 | schema: | |
3252 | type: array | |
3253 | items: | |
b8375da9 | 3254 | $ref: '#/components/schemas/Video/properties/id' |
0590bb46 C |
3255 | responses: |
3256 | '200': | |
3257 | description: successful operation | |
3258 | content: | |
3259 | application/json: | |
3260 | schema: | |
3261 | type: object | |
3262 | properties: | |
3263 | videoId: | |
3264 | type: array | |
3265 | items: | |
3266 | type: object | |
3267 | properties: | |
3268 | playlistElementId: | |
06746a8b | 3269 | type: integer |
0590bb46 | 3270 | playlistId: |
06746a8b | 3271 | type: integer |
0590bb46 | 3272 | startTimestamp: |
06746a8b | 3273 | type: integer |
c00100b6 | 3274 | format: seconds |
0590bb46 | 3275 | stopTimestamp: |
06746a8b | 3276 | type: integer |
c00100b6 | 3277 | format: seconds |
0590bb46 | 3278 | |
3e9e6f2f | 3279 | '/accounts/{name}/video-channels': |
6b738c7a | 3280 | get: |
b029d58a | 3281 | summary: List video channels of an account |
6b738c7a | 3282 | tags: |
b029d58a C |
3283 | - Video Channels |
3284 | - Accounts | |
6b738c7a | 3285 | parameters: |
3e9e6f2f | 3286 | - $ref: '#/components/parameters/name' |
84f6e32c RK |
3287 | - name: withStats |
3288 | in: query | |
3289 | description: include view statistics for the last 30 days (only if authentified as the account user) | |
3290 | schema: | |
3291 | type: boolean | |
3292 | - $ref: '#/components/parameters/start' | |
3293 | - $ref: '#/components/parameters/count' | |
3294 | - $ref: '#/components/parameters/sort' | |
6b738c7a C |
3295 | responses: |
3296 | '200': | |
3297 | description: successful operation | |
3e9e6f2f RK |
3298 | content: |
3299 | application/json: | |
3300 | schema: | |
045bcd0d | 3301 | $ref: '#/components/schemas/VideoChannelList' |
3f71c4c0 | 3302 | |
c100a614 YB |
3303 | '/accounts/{name}/ratings': |
3304 | get: | |
b029d58a | 3305 | summary: List ratings of an account |
c100a614 YB |
3306 | security: |
3307 | - OAuth2: [] | |
3308 | tags: | |
b029d58a | 3309 | - Accounts |
c100a614 | 3310 | parameters: |
cb9d028a | 3311 | - $ref: '#/components/parameters/name' |
c100a614 YB |
3312 | - $ref: '#/components/parameters/start' |
3313 | - $ref: '#/components/parameters/count' | |
3314 | - $ref: '#/components/parameters/sort' | |
3315 | - name: rating | |
3316 | in: query | |
3317 | required: false | |
b3d1054e | 3318 | description: Optionally filter which ratings to retrieve |
c100a614 YB |
3319 | schema: |
3320 | type: string | |
3321 | enum: | |
3322 | - like | |
3323 | - dislike | |
3324 | responses: | |
3325 | '200': | |
3326 | description: successful operation | |
3327 | content: | |
3328 | application/json: | |
3329 | schema: | |
3330 | type: array | |
3331 | items: | |
3332 | $ref: '#/components/schemas/VideoRating' | |
3f71c4c0 | 3333 | |
3e9e6f2f | 3334 | '/videos/{id}/comment-threads': |
1569a818 | 3335 | get: |
b029d58a | 3336 | summary: List threads of a video |
1569a818 | 3337 | tags: |
b029d58a | 3338 | - Video Comments |
1569a818 | 3339 | parameters: |
cb9d028a | 3340 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f RK |
3341 | - $ref: '#/components/parameters/start' |
3342 | - $ref: '#/components/parameters/count' | |
71810d0b | 3343 | - $ref: '#/components/parameters/commentsSort' |
1569a818 DG |
3344 | responses: |
3345 | '200': | |
3346 | description: successful operation | |
3e9e6f2f RK |
3347 | content: |
3348 | application/json: | |
3349 | schema: | |
3350 | $ref: '#/components/schemas/CommentThreadResponse' | |
1569a818 | 3351 | post: |
b029d58a | 3352 | summary: Create a thread |
94ff4c23 | 3353 | security: |
3e9e6f2f | 3354 | - OAuth2: [] |
1569a818 | 3355 | tags: |
b029d58a | 3356 | - Video Comments |
1569a818 | 3357 | parameters: |
cb9d028a | 3358 | - $ref: '#/components/parameters/idOrUUID' |
1569a818 DG |
3359 | responses: |
3360 | '200': | |
3361 | description: successful operation | |
3e9e6f2f RK |
3362 | content: |
3363 | application/json: | |
3364 | schema: | |
3365 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
2c318664 RK |
3366 | '404': |
3367 | description: video does not exist | |
98639806 C |
3368 | requestBody: |
3369 | content: | |
3370 | application/json: | |
3371 | schema: | |
3372 | type: object | |
3373 | properties: | |
3374 | text: | |
bf3c3fea RK |
3375 | allOf: |
3376 | - $ref: '#/components/schemas/VideoComment/properties/text' | |
3377 | format: markdown | |
3378 | maxLength: 10000 | |
98639806 C |
3379 | required: |
3380 | - text | |
3381 | ||
3e9e6f2f | 3382 | '/videos/{id}/comment-threads/{threadId}': |
1569a818 | 3383 | get: |
b029d58a | 3384 | summary: Get a thread |
1569a818 | 3385 | tags: |
b029d58a | 3386 | - Video Comments |
1569a818 | 3387 | parameters: |
cb9d028a C |
3388 | - $ref: '#/components/parameters/idOrUUID' |
3389 | - $ref: '#/components/parameters/threadId' | |
1569a818 DG |
3390 | responses: |
3391 | '200': | |
3392 | description: successful operation | |
3e9e6f2f RK |
3393 | content: |
3394 | application/json: | |
3395 | schema: | |
3396 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
3f71c4c0 | 3397 | |
3e9e6f2f | 3398 | '/videos/{id}/comments/{commentId}': |
1569a818 | 3399 | post: |
b029d58a | 3400 | summary: Reply to a thread of a video |
94ff4c23 | 3401 | security: |
3e9e6f2f | 3402 | - OAuth2: [] |
1569a818 | 3403 | tags: |
b029d58a | 3404 | - Video Comments |
1569a818 | 3405 | parameters: |
cb9d028a | 3406 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f | 3407 | - $ref: '#/components/parameters/commentId' |
1569a818 DG |
3408 | responses: |
3409 | '200': | |
3410 | description: successful operation | |
3e9e6f2f RK |
3411 | content: |
3412 | application/json: | |
3413 | schema: | |
3414 | $ref: '#/components/schemas/CommentThreadPostResponse' | |
2c318664 RK |
3415 | '404': |
3416 | description: thread or video does not exist | |
98639806 C |
3417 | requestBody: |
3418 | content: | |
3419 | application/json: | |
3420 | schema: | |
3421 | type: object | |
3422 | properties: | |
3423 | text: | |
bf3c3fea RK |
3424 | allOf: |
3425 | - $ref: '#/components/schemas/VideoComment/properties/text' | |
3426 | format: markdown | |
3427 | maxLength: 10000 | |
98639806 C |
3428 | required: |
3429 | - text | |
1569a818 | 3430 | delete: |
b029d58a | 3431 | summary: Delete a comment or a reply |
94ff4c23 | 3432 | security: |
3e9e6f2f | 3433 | - OAuth2: [] |
1569a818 | 3434 | tags: |
b029d58a | 3435 | - Video Comments |
1569a818 | 3436 | parameters: |
cb9d028a | 3437 | - $ref: '#/components/parameters/idOrUUID' |
3e9e6f2f | 3438 | - $ref: '#/components/parameters/commentId' |
1569a818 DG |
3439 | responses: |
3440 | '204': | |
c1843150 | 3441 | description: successful operation |
84f6e32c RK |
3442 | '403': |
3443 | description: cannot remove comment of another user | |
3444 | '404': | |
3445 | description: comment or video does not exist | |
3446 | '409': | |
3447 | description: comment is already deleted | |
3f71c4c0 | 3448 | |
3e9e6f2f | 3449 | '/videos/{id}/rate': |
1569a818 | 3450 | put: |
b029d58a | 3451 | summary: Like/dislike a video |
94ff4c23 | 3452 | security: |
3e9e6f2f | 3453 | - OAuth2: [] |
1569a818 | 3454 | tags: |
b029d58a | 3455 | - Video Rates |
1569a818 | 3456 | parameters: |
cb9d028a | 3457 | - $ref: '#/components/parameters/idOrUUID' |
4c440ced RK |
3458 | requestBody: |
3459 | content: | |
3460 | application/json: | |
3461 | schema: | |
3462 | type: object | |
3463 | properties: | |
3464 | rating: | |
3465 | type: string | |
3466 | enum: | |
3467 | - like | |
3468 | - dislike | |
9a320a06 RK |
3469 | required: |
3470 | - rating | |
1569a818 DG |
3471 | responses: |
3472 | '204': | |
c1843150 | 3473 | description: successful operation |
2c318664 RK |
3474 | '404': |
3475 | description: video does not exist | |
3f71c4c0 | 3476 | |
fb72c193 DL |
3477 | /search/videos: |
3478 | get: | |
3479 | tags: | |
3480 | - Search | |
b029d58a | 3481 | summary: Search videos |
e2adb8cb | 3482 | operationId: searchVideos |
fb72c193 | 3483 | parameters: |
84f6e32c RK |
3484 | - name: search |
3485 | in: query | |
3486 | required: true | |
3487 | allowEmptyValue: false | |
3488 | description: > | |
3489 | String to search. If the user can make a remote URI search, and the string is an URI then the | |
3490 | PeerTube instance will fetch the remote object and add it to its database. Then, | |
3491 | you can use the REST API to fetch the complete video information and interact with it. | |
3492 | schema: | |
3493 | type: string | |
59c794a5 | 3494 | - $ref: '#/components/parameters/categoryOneOf' |
1fd61899 | 3495 | - $ref: '#/components/parameters/isLive' |
59c794a5 C |
3496 | - $ref: '#/components/parameters/tagsOneOf' |
3497 | - $ref: '#/components/parameters/tagsAllOf' | |
3498 | - $ref: '#/components/parameters/licenceOneOf' | |
3499 | - $ref: '#/components/parameters/languageOneOf' | |
3500 | - $ref: '#/components/parameters/nsfw' | |
3501 | - $ref: '#/components/parameters/filter' | |
3502 | - $ref: '#/components/parameters/skipCount' | |
3e9e6f2f RK |
3503 | - $ref: '#/components/parameters/start' |
3504 | - $ref: '#/components/parameters/count' | |
ad031145 | 3505 | - $ref: '#/components/parameters/searchTarget' |
fd5af7a2 | 3506 | - $ref: '#/components/parameters/videosSearchSort' |
ad031145 C |
3507 | - name: startDate |
3508 | in: query | |
ad031145 C |
3509 | description: Get videos that are published after this date |
3510 | schema: | |
3511 | type: string | |
3512 | format: date-time | |
3513 | - name: endDate | |
3514 | in: query | |
ad031145 C |
3515 | description: Get videos that are published before this date |
3516 | schema: | |
3517 | type: string | |
3518 | format: date-time | |
3519 | - name: originallyPublishedStartDate | |
3520 | in: query | |
ad031145 | 3521 | description: Get videos that are originally published after this date |
3e9e6f2f RK |
3522 | schema: |
3523 | type: string | |
ad031145 C |
3524 | format: date-time |
3525 | - name: originallyPublishedEndDate | |
3526 | in: query | |
ad031145 C |
3527 | description: Get videos that are originally published before this date |
3528 | schema: | |
3529 | type: string | |
3530 | format: date-time | |
3531 | - name: durationMin | |
3532 | in: query | |
ad031145 C |
3533 | description: Get videos that have this minimum duration |
3534 | schema: | |
06746a8b | 3535 | type: integer |
ad031145 C |
3536 | - name: durationMax |
3537 | in: query | |
ad031145 C |
3538 | description: Get videos that have this maximum duration |
3539 | schema: | |
06746a8b | 3540 | type: integer |
2c318664 RK |
3541 | callbacks: |
3542 | 'searchTarget === search-index': | |
3543 | $ref: '#/components/callbacks/searchIndex' | |
fb72c193 DL |
3544 | responses: |
3545 | '200': | |
3546 | description: successful operation | |
3e9e6f2f RK |
3547 | content: |
3548 | application/json: | |
3549 | schema: | |
048b6946 | 3550 | $ref: '#/components/schemas/VideoListResponse' |
2c318664 RK |
3551 | '500': |
3552 | description: search index unavailable | |
3f71c4c0 | 3553 | |
ad031145 C |
3554 | /search/video-channels: |
3555 | get: | |
3556 | tags: | |
3557 | - Search | |
3558 | summary: Search channels | |
e2adb8cb | 3559 | operationId: searchChannels |
ad031145 | 3560 | parameters: |
ad031145 C |
3561 | - name: search |
3562 | in: query | |
3563 | required: true | |
3564 | description: > | |
3565 | String to search. If the user can make a remote URI search, and the string is an URI then the | |
3566 | PeerTube instance will fetch the remote object and add it to its database. Then, | |
3567 | you can use the REST API to fetch the complete channel information and interact with it. | |
3568 | schema: | |
3569 | type: string | |
84f6e32c RK |
3570 | - $ref: '#/components/parameters/start' |
3571 | - $ref: '#/components/parameters/count' | |
3572 | - $ref: '#/components/parameters/searchTarget' | |
3573 | - $ref: '#/components/parameters/sort' | |
2c318664 RK |
3574 | callbacks: |
3575 | 'searchTarget === search-index': | |
3576 | $ref: '#/components/callbacks/searchIndex' | |
ad031145 C |
3577 | responses: |
3578 | '200': | |
3579 | description: successful operation | |
3580 | content: | |
3581 | application/json: | |
3582 | schema: | |
045bcd0d | 3583 | $ref: '#/components/schemas/VideoChannelList' |
2c318664 RK |
3584 | '500': |
3585 | description: search index unavailable | |
da35b419 RK |
3586 | |
3587 | /server/blocklist/accounts: | |
06746a8b RK |
3588 | get: |
3589 | tags: | |
3590 | - Account Blocks | |
3591 | summary: List account blocks | |
3592 | security: | |
3593 | - OAuth2: | |
3594 | - admin | |
3595 | parameters: | |
3596 | - $ref: '#/components/parameters/start' | |
3597 | - $ref: '#/components/parameters/count' | |
3598 | - $ref: '#/components/parameters/sort' | |
3599 | responses: | |
3600 | '200': | |
3601 | description: successful operation | |
3602 | post: | |
3603 | tags: | |
3604 | - Account Blocks | |
3605 | summary: Block an account | |
3606 | security: | |
3607 | - OAuth2: | |
3608 | - admin | |
3609 | requestBody: | |
3610 | content: | |
3611 | application/json: | |
3612 | schema: | |
3613 | type: object | |
3614 | properties: | |
3615 | accountName: | |
3616 | type: string | |
84f6e32c | 3617 | example: chocobozzz@example.org |
06746a8b RK |
3618 | description: account to block, in the form `username@domain` |
3619 | required: | |
3620 | - accountName | |
3621 | responses: | |
3622 | '200': | |
3623 | description: successful operation | |
3624 | '409': | |
3625 | description: self-blocking forbidden | |
3f71c4c0 | 3626 | |
da35b419 | 3627 | '/server/blocklist/accounts/{accountName}': |
06746a8b RK |
3628 | delete: |
3629 | tags: | |
3630 | - Account Blocks | |
3631 | summary: Unblock an account by its handle | |
3632 | security: | |
3633 | - OAuth2: | |
3634 | - admin | |
3635 | parameters: | |
3636 | - name: accountName | |
3637 | in: path | |
3638 | required: true | |
3639 | description: account to unblock, in the form `username@domain` | |
3640 | schema: | |
3641 | type: string | |
3642 | responses: | |
3643 | '201': | |
3644 | description: successful operation | |
3645 | '404': | |
3646 | description: account or account block does not exist | |
da35b419 RK |
3647 | |
3648 | /server/blocklist/servers: | |
06746a8b RK |
3649 | get: |
3650 | tags: | |
3651 | - Server Blocks | |
3652 | summary: List server blocks | |
3653 | security: | |
3654 | - OAuth2: | |
3655 | - admin | |
3656 | parameters: | |
3657 | - $ref: '#/components/parameters/start' | |
3658 | - $ref: '#/components/parameters/count' | |
3659 | - $ref: '#/components/parameters/sort' | |
3660 | responses: | |
3661 | '200': | |
3662 | description: successful operation | |
3663 | post: | |
3664 | tags: | |
3665 | - Server Blocks | |
3666 | summary: Block a server | |
3667 | security: | |
3668 | - OAuth2: | |
3669 | - admin | |
3670 | requestBody: | |
3671 | content: | |
3672 | application/json: | |
3673 | schema: | |
3674 | type: object | |
3675 | properties: | |
84f6e32c | 3676 | host: |
06746a8b | 3677 | type: string |
84f6e32c | 3678 | format: hostname |
06746a8b RK |
3679 | description: server domain to block |
3680 | required: | |
84f6e32c | 3681 | - host |
06746a8b | 3682 | responses: |
ca98c8f8 | 3683 | '204': |
06746a8b RK |
3684 | description: successful operation |
3685 | '409': | |
3686 | description: self-blocking forbidden | |
3f71c4c0 | 3687 | |
da35b419 | 3688 | '/server/blocklist/servers/{host}': |
06746a8b RK |
3689 | delete: |
3690 | tags: | |
3691 | - Server Blocks | |
3692 | summary: Unblock a server by its domain | |
3693 | security: | |
3694 | - OAuth2: | |
3695 | - admin | |
3696 | parameters: | |
3697 | - name: host | |
3698 | in: path | |
3699 | required: true | |
3700 | description: server domain to unblock | |
3701 | schema: | |
3702 | type: string | |
84f6e32c | 3703 | format: hostname |
06746a8b | 3704 | responses: |
ca98c8f8 | 3705 | '204': |
06746a8b RK |
3706 | description: successful operation |
3707 | '404': | |
3708 | description: account block does not exist | |
da35b419 | 3709 | |
a4ce4223 | 3710 | /server/redundancy/{host}: |
04b703f6 RK |
3711 | put: |
3712 | tags: | |
3713 | - Instance Redundancy | |
3714 | summary: Update a server redundancy policy | |
3715 | security: | |
3716 | - OAuth2: | |
3717 | - admin | |
3718 | parameters: | |
3719 | - name: host | |
3720 | in: path | |
3721 | required: true | |
3722 | description: server domain to mirror | |
3723 | schema: | |
3724 | type: string | |
84f6e32c | 3725 | format: hostname |
04b703f6 RK |
3726 | requestBody: |
3727 | content: | |
3728 | application/json: | |
3729 | schema: | |
3730 | type: object | |
3731 | properties: | |
3732 | redundancyAllowed: | |
3733 | type: boolean | |
3734 | description: allow mirroring of the host's local videos | |
3735 | required: | |
3736 | - redundancyAllowed | |
3737 | responses: | |
3738 | '204': | |
3739 | description: successful operation | |
3740 | '404': | |
3741 | description: server is not already known | |
3f71c4c0 | 3742 | |
a4ce4223 | 3743 | /server/redundancy/videos: |
04b703f6 RK |
3744 | get: |
3745 | tags: | |
3746 | - Video Mirroring | |
3747 | summary: List videos being mirrored | |
e2adb8cb | 3748 | operationId: getMirroredVideos |
04b703f6 RK |
3749 | security: |
3750 | - OAuth2: | |
3751 | - admin | |
3752 | parameters: | |
3753 | - name: target | |
3754 | in: query | |
3755 | required: true | |
3756 | description: direction of the mirror | |
3757 | schema: | |
3758 | type: string | |
3759 | enum: | |
3760 | - my-videos | |
3761 | - remote-videos | |
3762 | - $ref: '#/components/parameters/start' | |
3763 | - $ref: '#/components/parameters/count' | |
3764 | - $ref: '#/components/parameters/videoRedundanciesSort' | |
3765 | responses: | |
3766 | '200': | |
3767 | description: successful operation | |
3768 | content: | |
3769 | application/json: | |
3770 | schema: | |
3771 | type: array | |
3772 | items: | |
3773 | $ref: '#/components/schemas/VideoRedundancy' | |
3774 | post: | |
3775 | tags: | |
3776 | - Video Mirroring | |
3777 | summary: Mirror a video | |
e2adb8cb | 3778 | operationId: putMirroredVideo |
04b703f6 RK |
3779 | security: |
3780 | - OAuth2: | |
3781 | - admin | |
3782 | requestBody: | |
3783 | content: | |
3784 | application/json: | |
3785 | schema: | |
3786 | type: object | |
3787 | properties: | |
3788 | videoId: | |
b8375da9 | 3789 | $ref: '#/components/schemas/Video/properties/id' |
04b703f6 RK |
3790 | required: |
3791 | - videoId | |
3792 | responses: | |
3793 | '204': | |
3794 | description: successful operation | |
3795 | '400': | |
3796 | description: cannot mirror a local video | |
3797 | '404': | |
3798 | description: video does not exist | |
3799 | '409': | |
3800 | description: video is already mirrored | |
3f71c4c0 | 3801 | |
a4ce4223 | 3802 | /server/redundancy/videos/{redundancyId}: |
04b703f6 RK |
3803 | delete: |
3804 | tags: | |
3805 | - Video Mirroring | |
3806 | summary: Delete a mirror done on a video | |
e2adb8cb | 3807 | operationId: delMirroredVideo |
04b703f6 RK |
3808 | security: |
3809 | - OAuth2: | |
3810 | - admin | |
3811 | parameters: | |
3812 | - name: redundancyId | |
3813 | in: path | |
3814 | required: true | |
3815 | description: id of an existing redundancy on a video | |
3816 | schema: | |
3817 | type: string | |
3818 | responses: | |
3819 | '204': | |
3820 | description: successful operation | |
3821 | '404': | |
3822 | description: video redundancy not found | |
da35b419 | 3823 | |
06746a8b RK |
3824 | '/feeds/video-comments.{format}': |
3825 | get: | |
3826 | tags: | |
3827 | - Feeds | |
3828 | summary: List comments on videos | |
e2adb8cb | 3829 | operationId: getSyndicatedComments |
06746a8b RK |
3830 | parameters: |
3831 | - name: format | |
3832 | in: path | |
3833 | required: true | |
00494d6e | 3834 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' |
06746a8b RK |
3835 | schema: |
3836 | type: string | |
3837 | enum: | |
3838 | - xml | |
3839 | - rss | |
3840 | - rss2 | |
3841 | - atom | |
3842 | - atom1 | |
3843 | - json | |
3844 | - json1 | |
3845 | - name: videoId | |
d73810be | 3846 | in: query |
06746a8b RK |
3847 | description: 'limit listing to a specific video' |
3848 | schema: | |
3849 | type: string | |
00494d6e RK |
3850 | - name: accountId |
3851 | in: query | |
3852 | description: 'limit listing to a specific account' | |
3853 | schema: | |
3854 | type: string | |
3855 | - name: accountName | |
3856 | in: query | |
3857 | description: 'limit listing to a specific account' | |
3858 | schema: | |
3859 | type: string | |
3860 | - name: videoChannelId | |
3861 | in: query | |
3862 | description: 'limit listing to a specific video channel' | |
3863 | schema: | |
3864 | type: string | |
3865 | - name: videoChannelName | |
3866 | in: query | |
3867 | description: 'limit listing to a specific video channel' | |
3868 | schema: | |
3869 | type: string | |
06746a8b RK |
3870 | responses: |
3871 | '204': | |
3872 | description: successful operation | |
3873 | headers: | |
3874 | Cache-Control: | |
3875 | schema: | |
3876 | type: string | |
3877 | default: 'max-age=900' # 15 min cache | |
3878 | content: | |
3879 | application/xml: | |
3880 | schema: | |
3881 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3882 | examples: |
3883 | nightly: | |
3884 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
06746a8b RK |
3885 | application/rss+xml: |
3886 | schema: | |
3887 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3888 | examples: |
3889 | nightly: | |
3890 | externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local | |
06746a8b RK |
3891 | text/xml: |
3892 | schema: | |
3893 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3894 | examples: |
3895 | nightly: | |
3896 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
06746a8b RK |
3897 | application/atom+xml: |
3898 | schema: | |
3899 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3900 | examples: |
3901 | nightly: | |
3902 | externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local | |
06746a8b RK |
3903 | application/json: |
3904 | schema: | |
3905 | type: object | |
64df4b65 RK |
3906 | examples: |
3907 | nightly: | |
3908 | externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local | |
00494d6e RK |
3909 | '400': |
3910 | x-summary: field inconsistencies | |
3911 | description: > | |
3912 | Arises when: | |
3913 | - videoId filter is mixed with a channel filter | |
3914 | '404': | |
3915 | description: video, video channel or account not found | |
06746a8b RK |
3916 | '406': |
3917 | description: accept header unsupported | |
3f71c4c0 | 3918 | |
06746a8b RK |
3919 | '/feeds/videos.{format}': |
3920 | get: | |
3921 | tags: | |
3922 | - Feeds | |
3923 | summary: List videos | |
e2adb8cb | 3924 | operationId: getSyndicatedVideos |
06746a8b RK |
3925 | parameters: |
3926 | - name: format | |
3927 | in: path | |
3928 | required: true | |
00494d6e | 3929 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' |
06746a8b RK |
3930 | schema: |
3931 | type: string | |
3932 | enum: | |
3933 | - xml | |
3934 | - rss | |
3935 | - rss2 | |
3936 | - atom | |
3937 | - atom1 | |
3938 | - json | |
3939 | - json1 | |
3940 | - name: accountId | |
d73810be | 3941 | in: query |
06746a8b RK |
3942 | description: 'limit listing to a specific account' |
3943 | schema: | |
3944 | type: string | |
3945 | - name: accountName | |
d73810be | 3946 | in: query |
06746a8b RK |
3947 | description: 'limit listing to a specific account' |
3948 | schema: | |
3949 | type: string | |
3950 | - name: videoChannelId | |
d73810be | 3951 | in: query |
06746a8b RK |
3952 | description: 'limit listing to a specific video channel' |
3953 | schema: | |
3954 | type: string | |
3955 | - name: videoChannelName | |
d73810be | 3956 | in: query |
06746a8b RK |
3957 | description: 'limit listing to a specific video channel' |
3958 | schema: | |
3959 | type: string | |
84f6e32c RK |
3960 | - $ref: '#/components/parameters/sort' |
3961 | - $ref: '#/components/parameters/nsfw' | |
3962 | - $ref: '#/components/parameters/filter' | |
06746a8b RK |
3963 | responses: |
3964 | '204': | |
3965 | description: successful operation | |
3966 | headers: | |
3967 | Cache-Control: | |
3968 | schema: | |
3969 | type: string | |
3970 | default: 'max-age=900' # 15 min cache | |
3971 | content: | |
3972 | application/xml: | |
3973 | schema: | |
3974 | $ref: '#/components/schemas/VideosForXML' | |
84f6e32c RK |
3975 | examples: |
3976 | nightly: | |
3977 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
06746a8b RK |
3978 | application/rss+xml: |
3979 | schema: | |
3980 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
3981 | examples: |
3982 | nightly: | |
3983 | externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local | |
06746a8b RK |
3984 | text/xml: |
3985 | schema: | |
3986 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
3987 | examples: |
3988 | nightly: | |
3989 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
06746a8b RK |
3990 | application/atom+xml: |
3991 | schema: | |
3992 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
3993 | examples: |
3994 | nightly: | |
3995 | externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local | |
06746a8b RK |
3996 | application/json: |
3997 | schema: | |
3998 | type: object | |
64df4b65 RK |
3999 | examples: |
4000 | nightly: | |
4001 | externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local | |
00494d6e RK |
4002 | '404': |
4003 | description: video channel or account not found | |
06746a8b RK |
4004 | '406': |
4005 | description: accept header unsupported | |
3f71c4c0 | 4006 | |
64df4b65 RK |
4007 | '/feeds/subscriptions.{format}': |
4008 | get: | |
4009 | tags: | |
4010 | - Feeds | |
4011 | - Account | |
4012 | summary: List videos of subscriptions tied to a token | |
e2adb8cb | 4013 | operationId: getSyndicatedSubscriptionVideos |
64df4b65 RK |
4014 | parameters: |
4015 | - name: format | |
4016 | in: path | |
4017 | required: true | |
4018 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | |
4019 | schema: | |
4020 | type: string | |
4021 | enum: | |
4022 | - xml | |
4023 | - rss | |
4024 | - rss2 | |
4025 | - atom | |
4026 | - atom1 | |
4027 | - json | |
4028 | - json1 | |
4029 | - name: accountId | |
4030 | in: query | |
4031 | description: limit listing to a specific account | |
4032 | schema: | |
4033 | type: string | |
4034 | required: true | |
4035 | - name: token | |
4036 | in: query | |
4037 | description: private token allowing access | |
4038 | schema: | |
4039 | type: string | |
4040 | required: true | |
4041 | - $ref: '#/components/parameters/sort' | |
4042 | - $ref: '#/components/parameters/nsfw' | |
4043 | - $ref: '#/components/parameters/filter' | |
4044 | responses: | |
4045 | '204': | |
4046 | description: successful operation | |
4047 | headers: | |
4048 | Cache-Control: | |
4049 | schema: | |
4050 | type: string | |
4051 | default: 'max-age=900' # 15 min cache | |
4052 | content: | |
4053 | application/xml: | |
4054 | schema: | |
4055 | $ref: '#/components/schemas/VideosForXML' | |
4056 | application/rss+xml: | |
4057 | schema: | |
4058 | $ref: '#/components/schemas/VideosForXML' | |
4059 | text/xml: | |
4060 | schema: | |
4061 | $ref: '#/components/schemas/VideosForXML' | |
4062 | application/atom+xml: | |
4063 | schema: | |
4064 | $ref: '#/components/schemas/VideosForXML' | |
4065 | application/json: | |
4066 | schema: | |
4067 | type: object | |
4068 | '406': | |
4069 | description: accept header unsupported | |
3f71c4c0 | 4070 | |
7461d440 RK |
4071 | /plugins: |
4072 | get: | |
4073 | tags: | |
4074 | - Plugins | |
4075 | summary: List plugins | |
e2adb8cb | 4076 | operationId: getPlugins |
7461d440 RK |
4077 | security: |
4078 | - OAuth2: | |
4079 | - admin | |
4080 | parameters: | |
4081 | - name: pluginType | |
4082 | in: query | |
4083 | schema: | |
4084 | type: integer | |
4085 | - name: uninstalled | |
4086 | in: query | |
4087 | schema: | |
4088 | type: boolean | |
4089 | - $ref: '#/components/parameters/start' | |
4090 | - $ref: '#/components/parameters/count' | |
4091 | - $ref: '#/components/parameters/sort' | |
4092 | responses: | |
4093 | '200': | |
4094 | description: successful operation | |
4095 | content: | |
4096 | application/json: | |
4097 | schema: | |
4098 | $ref: '#/components/schemas/PluginResponse' | |
3f71c4c0 | 4099 | |
7461d440 RK |
4100 | /plugins/available: |
4101 | get: | |
4102 | tags: | |
4103 | - Plugins | |
4104 | summary: List available plugins | |
e2adb8cb | 4105 | operationId: getAvailablePlugins |
7461d440 RK |
4106 | security: |
4107 | - OAuth2: | |
4108 | - admin | |
4109 | parameters: | |
4110 | - name: search | |
4111 | in: query | |
4112 | schema: | |
4113 | type: string | |
4114 | - name: pluginType | |
4115 | in: query | |
4116 | schema: | |
4117 | type: integer | |
4118 | - name: currentPeerTubeEngine | |
4119 | in: query | |
4120 | schema: | |
4121 | type: string | |
4122 | - $ref: '#/components/parameters/start' | |
4123 | - $ref: '#/components/parameters/count' | |
4124 | - $ref: '#/components/parameters/sort' | |
4125 | responses: | |
4126 | '200': | |
4127 | description: successful operation | |
4128 | content: | |
4129 | application/json: | |
4130 | schema: | |
4131 | $ref: '#/components/schemas/PluginResponse' | |
4132 | '503': | |
4133 | description: plugin index unavailable | |
3f71c4c0 | 4134 | |
7461d440 RK |
4135 | /plugins/install: |
4136 | post: | |
4137 | tags: | |
4138 | - Plugins | |
4139 | summary: Install a plugin | |
e2adb8cb | 4140 | operationId: addPlugin |
7461d440 RK |
4141 | security: |
4142 | - OAuth2: | |
4143 | - admin | |
4144 | requestBody: | |
4145 | content: | |
4146 | application/json: | |
4147 | schema: | |
4148 | oneOf: | |
4149 | - type: object | |
4150 | properties: | |
4151 | npmName: | |
4152 | type: string | |
84f6e32c | 4153 | example: peertube-plugin-auth-ldap |
7461d440 RK |
4154 | required: |
4155 | - npmName | |
4156 | additionalProperties: false | |
4157 | - type: object | |
4158 | properties: | |
4159 | path: | |
4160 | type: string | |
4161 | required: | |
4162 | - path | |
4163 | additionalProperties: false | |
4164 | responses: | |
4165 | '204': | |
4166 | description: successful operation | |
4167 | '400': | |
4168 | description: should have either `npmName` or `path` set | |
3f71c4c0 | 4169 | |
7461d440 RK |
4170 | /plugins/update: |
4171 | post: | |
4172 | tags: | |
4173 | - Plugins | |
4174 | summary: Update a plugin | |
e2adb8cb | 4175 | operationId: updatePlugin |
7461d440 RK |
4176 | security: |
4177 | - OAuth2: | |
4178 | - admin | |
4179 | requestBody: | |
4180 | content: | |
4181 | application/json: | |
4182 | schema: | |
4183 | oneOf: | |
4184 | - type: object | |
4185 | properties: | |
4186 | npmName: | |
4187 | type: string | |
84f6e32c | 4188 | example: peertube-plugin-auth-ldap |
7461d440 RK |
4189 | required: |
4190 | - npmName | |
4191 | additionalProperties: false | |
4192 | - type: object | |
4193 | properties: | |
4194 | path: | |
4195 | type: string | |
4196 | required: | |
4197 | - path | |
4198 | additionalProperties: false | |
4199 | responses: | |
4200 | '204': | |
4201 | description: successful operation | |
4202 | '400': | |
4203 | description: should have either `npmName` or `path` set | |
4204 | '404': | |
4205 | description: existing plugin not found | |
3f71c4c0 | 4206 | |
7461d440 RK |
4207 | /plugins/uninstall: |
4208 | post: | |
4209 | tags: | |
4210 | - Plugins | |
4211 | summary: Uninstall a plugin | |
e2adb8cb | 4212 | operationId: uninstallPlugin |
7461d440 RK |
4213 | security: |
4214 | - OAuth2: | |
4215 | - admin | |
4216 | requestBody: | |
4217 | content: | |
4218 | application/json: | |
4219 | schema: | |
4220 | type: object | |
4221 | properties: | |
4222 | npmName: | |
4223 | type: string | |
84f6e32c RK |
4224 | description: name of the plugin/theme in its package.json |
4225 | example: peertube-plugin-auth-ldap | |
7461d440 RK |
4226 | required: |
4227 | - npmName | |
4228 | responses: | |
4229 | '204': | |
4230 | description: successful operation | |
4231 | '404': | |
4232 | description: existing plugin not found | |
3f71c4c0 | 4233 | |
7461d440 RK |
4234 | /plugins/{npmName}: |
4235 | get: | |
4236 | tags: | |
4237 | - Plugins | |
4238 | summary: Get a plugin | |
e2adb8cb | 4239 | operationId: getPlugin |
7461d440 RK |
4240 | security: |
4241 | - OAuth2: | |
4242 | - admin | |
4243 | parameters: | |
84f6e32c | 4244 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4245 | responses: |
4246 | '200': | |
4247 | description: successful operation | |
4248 | content: | |
4249 | application/json: | |
4250 | schema: | |
4251 | $ref: '#/components/schemas/Plugin' | |
4252 | '404': | |
4253 | description: plugin not found | |
3f71c4c0 | 4254 | |
7461d440 RK |
4255 | /plugins/{npmName}/settings: |
4256 | put: | |
4257 | tags: | |
4258 | - Plugins | |
4259 | summary: Set a plugin's settings | |
4260 | security: | |
4261 | - OAuth2: | |
4262 | - admin | |
4263 | parameters: | |
84f6e32c | 4264 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4265 | requestBody: |
4266 | content: | |
4267 | application/json: | |
4268 | schema: | |
4269 | type: object | |
4270 | properties: | |
4271 | settings: | |
4272 | type: object | |
4273 | additionalProperties: true | |
4274 | responses: | |
4275 | '204': | |
4276 | description: successful operation | |
4277 | '404': | |
4278 | description: plugin not found | |
3f71c4c0 | 4279 | |
7461d440 RK |
4280 | /plugins/{npmName}/public-settings: |
4281 | get: | |
4282 | tags: | |
4283 | - Plugins | |
4284 | summary: Get a plugin's public settings | |
7461d440 | 4285 | parameters: |
84f6e32c | 4286 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4287 | responses: |
4288 | '200': | |
4289 | description: successful operation | |
4290 | content: | |
4291 | application/json: | |
4292 | schema: | |
4293 | type: object | |
4294 | additionalProperties: true | |
4295 | '404': | |
4296 | description: plugin not found | |
3f71c4c0 | 4297 | |
7461d440 RK |
4298 | /plugins/{npmName}/registered-settings: |
4299 | get: | |
4300 | tags: | |
4301 | - Plugins | |
4302 | summary: Get a plugin's registered settings | |
4303 | security: | |
4304 | - OAuth2: | |
4305 | - admin | |
4306 | parameters: | |
84f6e32c | 4307 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4308 | responses: |
4309 | '200': | |
4310 | description: successful operation | |
4311 | content: | |
4312 | application/json: | |
4313 | schema: | |
4314 | type: object | |
4315 | additionalProperties: true | |
4316 | '404': | |
4317 | description: plugin not found | |
3f71c4c0 | 4318 | |
3e9e6f2f | 4319 | servers: |
8f9e8be1 | 4320 | - url: 'https://peertube2.cpy.re/api/v1' |
f4d59981 | 4321 | description: Live Test Server (live data - latest nightly version) |
6441981b | 4322 | - url: 'https://peertube3.cpy.re/api/v1' |
b029d58a | 4323 | description: Live Test Server (live data - latest RC version) |
f4d59981 RK |
4324 | - url: 'https://peertube.cpy.re/api/v1' |
4325 | description: Live Test Server (live data - stable version) | |
3e9e6f2f RK |
4326 | components: |
4327 | parameters: | |
4328 | start: | |
4329 | name: start | |
4330 | in: query | |
4331 | required: false | |
06746a8b | 4332 | description: Offset used to paginate results |
3e9e6f2f | 4333 | schema: |
06746a8b | 4334 | type: integer |
84f6e32c | 4335 | minimum: 0 |
3e9e6f2f RK |
4336 | count: |
4337 | name: count | |
4338 | in: query | |
4339 | required: false | |
06746a8b | 4340 | description: "Number of items to return" |
3e9e6f2f | 4341 | schema: |
06746a8b | 4342 | type: integer |
84f6e32c | 4343 | default: 15 |
06746a8b RK |
4344 | maximum: 100 |
4345 | minimum: 1 | |
3e9e6f2f RK |
4346 | sort: |
4347 | name: sort | |
4348 | in: query | |
4349 | required: false | |
84f6e32c | 4350 | description: Sort column |
3e9e6f2f RK |
4351 | schema: |
4352 | type: string | |
84f6e32c | 4353 | example: -createdAt |
8491293b RK |
4354 | search: |
4355 | name: search | |
4356 | in: query | |
4357 | required: false | |
4358 | description: Plain text search, applied to various parts of the model depending on endpoint | |
4359 | schema: | |
4360 | type: string | |
ad031145 C |
4361 | searchTarget: |
4362 | name: searchTarget | |
4363 | in: query | |
4364 | required: false | |
4365 | description: > | |
4366 | If the administrator enabled search index support, you can override the default search target. | |
4367 | ||
4368 | ||
4369 | **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. | |
84f6e32c | 4370 | It means the instance may not yet know the objects you fetched. If you want to load video/channel information: |
ad031145 C |
4371 | * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), |
4372 | then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. | |
4373 | After that, you can use the classic REST API endpoints to fetch the complete object or interact with it | |
84f6e32c | 4374 | * 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 |
4375 | the data from the origin instance API |
4376 | schema: | |
4377 | type: string | |
4378 | enum: | |
4379 | - 'local' | |
4380 | - 'search-index' | |
fd5af7a2 RK |
4381 | videosSort: |
4382 | name: sort | |
4383 | in: query | |
4384 | required: false | |
4385 | description: Sort videos by criteria | |
4386 | schema: | |
4387 | type: string | |
4388 | enum: | |
04b703f6 | 4389 | - name |
fd5af7a2 RK |
4390 | - -duration |
4391 | - -createdAt | |
4392 | - -publishedAt | |
4393 | - -views | |
4394 | - -likes | |
4395 | - -trending | |
923d3d5a | 4396 | - -hot |
fd5af7a2 RK |
4397 | videosSearchSort: |
4398 | name: sort | |
4399 | in: query | |
4400 | required: false | |
4401 | description: Sort videos by criteria | |
4402 | schema: | |
4403 | type: string | |
4404 | enum: | |
04b703f6 | 4405 | - name |
fd5af7a2 RK |
4406 | - -duration |
4407 | - -createdAt | |
4408 | - -publishedAt | |
4409 | - -views | |
4410 | - -likes | |
4411 | - -match | |
71810d0b RK |
4412 | commentsSort: |
4413 | name: sort | |
4414 | in: query | |
4415 | required: false | |
4416 | description: Sort comments by criteria | |
4417 | schema: | |
4418 | type: string | |
4419 | enum: | |
4420 | - -createdAt | |
4421 | - -totalReplies | |
fd5af7a2 RK |
4422 | blacklistsSort: |
4423 | name: sort | |
4424 | in: query | |
4425 | required: false | |
c756bae0 | 4426 | description: Sort blocklists by criteria |
fd5af7a2 RK |
4427 | schema: |
4428 | type: string | |
4429 | enum: | |
4430 | - -id | |
04b703f6 | 4431 | - name |
fd5af7a2 RK |
4432 | - -duration |
4433 | - -views | |
4434 | - -likes | |
4435 | - -dislikes | |
4436 | - -uuid | |
4437 | - -createdAt | |
8491293b RK |
4438 | usersSearch: |
4439 | name: search | |
4440 | in: query | |
4441 | required: false | |
4442 | description: Plain text search that will match with user usernames or emails | |
4443 | schema: | |
4444 | type: string | |
4445 | usersBlocked: | |
4446 | name: blocked | |
4447 | in: query | |
4448 | required: false | |
4449 | description: Filter results down to (un)banned users | |
4450 | schema: | |
4451 | type: boolean | |
fd5af7a2 RK |
4452 | usersSort: |
4453 | name: sort | |
4454 | in: query | |
4455 | required: false | |
4456 | description: Sort users by criteria | |
4457 | schema: | |
4458 | type: string | |
4459 | enum: | |
4460 | - -id | |
4461 | - -username | |
4462 | - -createdAt | |
4463 | abusesSort: | |
4464 | name: sort | |
4465 | in: query | |
4466 | required: false | |
4467 | description: Sort abuses by criteria | |
4468 | schema: | |
4469 | type: string | |
4470 | enum: | |
4471 | - -id | |
4472 | - -createdAt | |
4473 | - -state | |
04b703f6 RK |
4474 | videoRedundanciesSort: |
4475 | name: sort | |
4476 | in: query | |
4477 | required: false | |
4478 | description: Sort abuses by criteria | |
4479 | schema: | |
4480 | type: string | |
4481 | enum: | |
4482 | - name | |
3e9e6f2f RK |
4483 | name: |
4484 | name: name | |
4485 | in: path | |
4486 | required: true | |
f2eb23cd | 4487 | description: The username or handle of the account |
3e9e6f2f RK |
4488 | schema: |
4489 | type: string | |
84f6e32c | 4490 | example: chocobozzz | chocobozzz@example.org |
3e9e6f2f RK |
4491 | id: |
4492 | name: id | |
4493 | in: path | |
4494 | required: true | |
4495 | description: The user id | |
4496 | schema: | |
b8375da9 | 4497 | $ref: '#/components/schemas/id' |
cb9d028a | 4498 | idOrUUID: |
3e9e6f2f RK |
4499 | name: id |
4500 | in: path | |
4501 | required: true | |
c1843150 | 4502 | description: The object id or uuid |
3e9e6f2f | 4503 | schema: |
84f6e32c | 4504 | oneOf: |
b8375da9 | 4505 | - $ref: '#/components/schemas/id' |
f880a5e7 | 4506 | - $ref: '#/components/schemas/UUIDv4' |
c00100b6 RK |
4507 | playlistId: |
4508 | name: playlistId | |
4509 | in: path | |
4510 | required: true | |
4511 | description: Playlist id | |
4512 | schema: | |
4513 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | |
c1843150 C |
4514 | playlistElementId: |
4515 | name: playlistElementId | |
4516 | in: path | |
4517 | required: true | |
4518 | description: Playlist element id | |
4519 | schema: | |
b8375da9 | 4520 | $ref: '#/components/schemas/id' |
50e16ccf C |
4521 | abuseId: |
4522 | name: abuseId | |
4523 | in: path | |
4524 | required: true | |
310b5219 | 4525 | description: Abuse id |
50e16ccf | 4526 | schema: |
b8375da9 | 4527 | $ref: '#/components/schemas/Abuse/properties/id' |
668b7f09 C |
4528 | abuseMessageId: |
4529 | name: abuseMessageId | |
4530 | in: path | |
4531 | required: true | |
4532 | description: Abuse message id | |
4533 | schema: | |
b8375da9 | 4534 | $ref: '#/components/schemas/AbuseMessage/properties/id' |
67ae04a5 C |
4535 | captionLanguage: |
4536 | name: captionLanguage | |
4537 | in: path | |
4538 | required: true | |
4539 | description: The caption language | |
4540 | schema: | |
b8375da9 | 4541 | $ref: '#/components/schemas/VideoLanguageSet' |
9ce3d302 C |
4542 | channelHandle: |
4543 | name: channelHandle | |
3e9e6f2f RK |
4544 | in: path |
4545 | required: true | |
84f6e32c | 4546 | description: The video channel handle |
3e9e6f2f RK |
4547 | schema: |
4548 | type: string | |
84f6e32c | 4549 | example: my_username | my_username@example.com |
cb9d028a C |
4550 | subscriptionHandle: |
4551 | name: subscriptionHandle | |
4552 | in: path | |
4553 | required: true | |
84f6e32c | 4554 | description: The subscription handle |
cb9d028a C |
4555 | schema: |
4556 | type: string | |
84f6e32c | 4557 | example: my_username | my_username@example.com |
cb9d028a | 4558 | threadId: |
3e9e6f2f RK |
4559 | name: threadId |
4560 | in: path | |
4561 | required: true | |
cb9d028a C |
4562 | description: The thread id (root comment id) |
4563 | schema: | |
85a60d8b | 4564 | type: integer |
cb9d028a C |
4565 | commentId: |
4566 | name: commentId | |
4567 | in: path | |
4568 | required: true | |
3e9e6f2f RK |
4569 | description: The comment id |
4570 | schema: | |
b8375da9 | 4571 | $ref: '#/components/schemas/VideoComment/properties/id' |
1fd61899 C |
4572 | isLive: |
4573 | name: isLive | |
4574 | in: query | |
4575 | required: false | |
4576 | description: whether or not the video is a live | |
4577 | schema: | |
4578 | type: boolean | |
fd5af7a2 RK |
4579 | categoryOneOf: |
4580 | name: categoryOneOf | |
4581 | in: query | |
4582 | required: false | |
40cfb36b | 4583 | description: category id of the video (see [/videos/categories](#operation/getCategories)) |
fd5af7a2 RK |
4584 | schema: |
4585 | oneOf: | |
b8375da9 | 4586 | - $ref: '#/components/schemas/VideoCategorySet' |
fd5af7a2 RK |
4587 | - type: array |
4588 | items: | |
b8375da9 | 4589 | $ref: '#/components/schemas/VideoCategorySet' |
2beb9895 RK |
4590 | style: form |
4591 | explode: false | |
fd5af7a2 RK |
4592 | tagsOneOf: |
4593 | name: tagsOneOf | |
4594 | in: query | |
4595 | required: false | |
4596 | description: tag(s) of the video | |
4597 | schema: | |
4598 | oneOf: | |
4599 | - type: string | |
4600 | - type: array | |
f6d6e7f8 | 4601 | maxItems: 5 |
fd5af7a2 RK |
4602 | items: |
4603 | type: string | |
2beb9895 RK |
4604 | style: form |
4605 | explode: false | |
fd5af7a2 RK |
4606 | tagsAllOf: |
4607 | name: tagsAllOf | |
4608 | in: query | |
4609 | required: false | |
4610 | description: tag(s) of the video, where all should be present in the video | |
4611 | schema: | |
4612 | oneOf: | |
4613 | - type: string | |
4614 | - type: array | |
4615 | items: | |
4616 | type: string | |
2beb9895 RK |
4617 | style: form |
4618 | explode: false | |
fd5af7a2 RK |
4619 | languageOneOf: |
4620 | name: languageOneOf | |
4621 | in: query | |
4622 | required: false | |
40cfb36b | 4623 | 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 |
4624 | schema: |
4625 | oneOf: | |
b8375da9 | 4626 | - $ref: '#/components/schemas/VideoLanguageSet' |
fd5af7a2 RK |
4627 | - type: array |
4628 | items: | |
b8375da9 | 4629 | $ref: '#/components/schemas/VideoLanguageSet' |
2beb9895 RK |
4630 | style: form |
4631 | explode: false | |
fd5af7a2 RK |
4632 | licenceOneOf: |
4633 | name: licenceOneOf | |
4634 | in: query | |
4635 | required: false | |
40cfb36b | 4636 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) |
fd5af7a2 RK |
4637 | schema: |
4638 | oneOf: | |
b8375da9 | 4639 | - $ref: '#/components/schemas/VideoLicenceSet' |
fd5af7a2 RK |
4640 | - type: array |
4641 | items: | |
b8375da9 | 4642 | $ref: '#/components/schemas/VideoLicenceSet' |
2beb9895 RK |
4643 | style: form |
4644 | explode: false | |
59c794a5 C |
4645 | skipCount: |
4646 | name: skipCount | |
4647 | in: query | |
4648 | required: false | |
4649 | description: if you don't need the `total` in the response | |
4650 | schema: | |
4651 | type: string | |
4652 | enum: | |
4653 | - 'true' | |
4654 | - 'false' | |
06746a8b | 4655 | default: 'false' |
fd5af7a2 RK |
4656 | nsfw: |
4657 | name: nsfw | |
4658 | in: query | |
4659 | required: false | |
4660 | description: whether to include nsfw videos, if any | |
4661 | schema: | |
4662 | type: string | |
4663 | enum: | |
4664 | - 'true' | |
4665 | - 'false' | |
4666 | filter: | |
4667 | name: filter | |
4668 | in: query | |
4669 | required: false | |
4670 | description: > | |
0aa52e17 | 4671 | Special filters which might require special rights: |
fd5af7a2 RK |
4672 | * `local` - only videos local to the instance |
4673 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
0aa52e17 | 4674 | * `all` - all videos, showing private and unlisted videos (requires Admin privileges) |
fd5af7a2 RK |
4675 | schema: |
4676 | type: string | |
4677 | enum: | |
4678 | - local | |
4679 | - all-local | |
e76d5784 RK |
4680 | subscriptionsUris: |
4681 | name: uris | |
4682 | in: query | |
4683 | required: true | |
4684 | description: list of uris to check if each is part of the user subscriptions | |
4685 | schema: | |
4686 | type: array | |
4687 | items: | |
4688 | type: string | |
84f6e32c RK |
4689 | format: uri |
4690 | npmName: | |
4691 | name: npmName | |
4692 | in: path | |
4693 | required: true | |
4694 | description: name of the plugin/theme on npmjs.com or in its package.json | |
4695 | schema: | |
4696 | type: string | |
4697 | example: peertube-plugin-auth-ldap | |
040d6896 RK |
4698 | jobType: |
4699 | name: jobType | |
4700 | in: query | |
4701 | required: false | |
4702 | description: job type | |
4703 | schema: | |
4704 | type: string | |
4705 | enum: | |
4706 | - activitypub-follow | |
4707 | - activitypub-http-broadcast | |
4708 | - activitypub-http-fetcher | |
4709 | - activitypub-http-unicast | |
4710 | ||
4711 | - video-transcoding | |
4712 | - video-file-import | |
4713 | - video-import | |
4714 | - videos-views | |
4715 | - activitypub-refresher | |
4716 | - video-redundancy | |
4717 | - video-live-ending | |
06dc7a1b RK |
4718 | followState: |
4719 | name: state | |
4720 | in: query | |
4721 | schema: | |
4722 | type: string | |
4723 | enum: | |
4724 | - pending | |
4725 | - accepted | |
4726 | actorType: | |
4727 | name: actorType | |
4728 | in: query | |
4729 | schema: | |
4730 | type: string | |
4731 | enum: | |
4732 | - Person | |
4733 | - Application | |
4734 | - Group | |
4735 | - Service | |
4736 | - Organization | |
3e9e6f2f RK |
4737 | securitySchemes: |
4738 | OAuth2: | |
3c5e02f3 | 4739 | description: | |
3e9e6f2f | 4740 | Authenticating via OAuth requires the following steps: |
3c5e02f3 | 4741 | - Have an activated account |
e2464d22 RK |
4742 | - [Generate] an access token for that account at `/api/v1/users/token`. |
4743 | - Make requests with the *Authorization: Bearer <token\>* header | |
3c5e02f3 | 4744 | - Profit, depending on the role assigned to the account |
3e9e6f2f | 4745 | |
e2464d22 | 4746 | Note that the __access token is valid for 1 day__ and is given |
3c5e02f3 | 4747 | along with a __refresh token valid for 2 weeks__. |
e2464d22 RK |
4748 | |
4749 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | |
3e9e6f2f RK |
4750 | type: oauth2 |
4751 | flows: | |
4752 | password: | |
e2464d22 | 4753 | tokenUrl: /api/v1/users/token |
3e9e6f2f RK |
4754 | scopes: |
4755 | admin: Admin scope | |
4756 | moderator: Moderator scope | |
4757 | user: User scope | |
4758 | schemas: | |
b8375da9 RK |
4759 | # Resuable core properties |
4760 | id: | |
4761 | type: integer | |
4762 | minimum: 1 | |
4763 | example: 42 | |
f880a5e7 RK |
4764 | UUIDv4: |
4765 | type: string | |
4766 | format: uuid | |
4767 | example: 9c9de5e8-0a1e-484a-b099-e80766180a6d | |
4768 | pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' | |
f880a5e7 RK |
4769 | minLength: 36 |
4770 | maxLength: 36 | |
b8375da9 RK |
4771 | username: |
4772 | type: string | |
77b0c6b5 | 4773 | description: immutable name of the user, used to find or mention its actor |
b8375da9 | 4774 | example: chocobozzz |
e2464d22 | 4775 | pattern: '/^[a-z0-9._]+$/' |
b8375da9 RK |
4776 | minLength: 1 |
4777 | maxLength: 50 | |
4778 | usernameChannel: | |
4779 | type: string | |
77b0c6b5 | 4780 | description: immutable name of the channel, used to interact with its actor |
9a320a06 | 4781 | example: framasoft_videos |
e2464d22 RK |
4782 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' |
4783 | minLength: 1 | |
4784 | maxLength: 50 | |
b8375da9 RK |
4785 | password: |
4786 | type: string | |
4787 | format: password | |
b8375da9 RK |
4788 | minLength: 6 |
4789 | maxLength: 255 | |
f880a5e7 | 4790 | |
40cfb36b RK |
4791 | VideoCategorySet: |
4792 | type: integer | |
4793 | description: category id of the video (see [/videos/categories](#operation/getCategories)) | |
b8375da9 | 4794 | example: 15 |
dfcb6f50 | 4795 | VideoConstantNumber-Category: |
3e9e6f2f RK |
4796 | properties: |
4797 | id: | |
40cfb36b | 4798 | $ref: '#/components/schemas/VideoCategorySet' |
3e9e6f2f RK |
4799 | label: |
4800 | type: string | |
b8375da9 | 4801 | example: Science & Technology |
40cfb36b RK |
4802 | |
4803 | VideoLicenceSet: | |
4804 | type: integer | |
4805 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) | |
b8375da9 | 4806 | example: 2 |
dfcb6f50 RK |
4807 | VideoConstantNumber-Licence: |
4808 | properties: | |
4809 | id: | |
40cfb36b | 4810 | $ref: '#/components/schemas/VideoLicenceSet' |
dfcb6f50 RK |
4811 | label: |
4812 | type: string | |
b8375da9 RK |
4813 | example: Attribution - Share Alike |
4814 | ||
40cfb36b RK |
4815 | VideoLanguageSet: |
4816 | type: string | |
4817 | description: language id of the video (see [/videos/languages](#operation/getLanguages)) | |
b8375da9 | 4818 | example: en |
dfcb6f50 | 4819 | VideoConstantString-Language: |
3e9e6f2f RK |
4820 | properties: |
4821 | id: | |
40cfb36b | 4822 | $ref: '#/components/schemas/VideoLanguageSet' |
3e9e6f2f RK |
4823 | label: |
4824 | type: string | |
b8375da9 | 4825 | example: English |
c1843150 C |
4826 | |
4827 | VideoPlaylistPrivacySet: | |
4828 | type: integer | |
4829 | enum: | |
4830 | - 1 | |
4831 | - 2 | |
4832 | - 3 | |
40cfb36b | 4833 | description: Video playlist privacy policy (see [/video-playlists/privacies]) |
c1843150 C |
4834 | VideoPlaylistPrivacyConstant: |
4835 | properties: | |
4836 | id: | |
4837 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
4838 | label: | |
4839 | type: string | |
4840 | ||
4841 | VideoPlaylistTypeSet: | |
4842 | type: integer | |
4843 | enum: | |
4844 | - 1 | |
4845 | - 2 | |
40cfb36b | 4846 | description: The video playlist type (Regular = `1`, Watch Later = `2`) |
c1843150 C |
4847 | VideoPlaylistTypeConstant: |
4848 | properties: | |
4849 | id: | |
4850 | $ref: '#/components/schemas/VideoPlaylistTypeSet' | |
4851 | label: | |
4852 | type: string | |
4853 | ||
ee89e8fd C |
4854 | VideoPrivacySet: |
4855 | type: integer | |
3e9e6f2f | 4856 | enum: |
ee89e8fd C |
4857 | - 1 |
4858 | - 2 | |
4859 | - 3 | |
c1843150 | 4860 | - 4 |
40cfb36b | 4861 | description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies)) |
ee89e8fd C |
4862 | VideoPrivacyConstant: |
4863 | properties: | |
4864 | id: | |
c1843150 | 4865 | $ref: '#/components/schemas/VideoPrivacySet' |
ee89e8fd C |
4866 | label: |
4867 | type: string | |
50e16ccf | 4868 | |
0590bb46 C |
4869 | NSFWPolicy: |
4870 | type: string | |
4871 | enum: | |
4872 | - display | |
4873 | - blur | |
4874 | - do_not_list | |
4875 | ||
4876 | UserRole: | |
06746a8b | 4877 | type: integer |
0590bb46 C |
4878 | enum: |
4879 | - 0 | |
4880 | - 1 | |
4881 | - 2 | |
06746a8b | 4882 | description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)' |
2c318664 | 4883 | example: 2 |
6d989edc C |
4884 | UserAdminFlags: |
4885 | type: integer | |
4886 | enum: | |
4887 | - 0 | |
4888 | - 1 | |
c756bae0 | 4889 | description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)' |
6d989edc | 4890 | example: 1 |
0590bb46 | 4891 | |
5dce26d2 C |
4892 | VideoStateConstant: |
4893 | properties: | |
4894 | id: | |
4895 | type: integer | |
4896 | enum: | |
4897 | - 1 | |
4898 | - 2 | |
4899 | - 3 | |
06746a8b | 4900 | description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)' |
5dce26d2 C |
4901 | label: |
4902 | type: string | |
50e16ccf | 4903 | |
4f32032f | 4904 | AbuseStateSet: |
50e16ccf C |
4905 | type: integer |
4906 | enum: | |
4907 | - 1 | |
4908 | - 2 | |
4909 | - 3 | |
668b7f09 | 4910 | description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)' |
4f32032f | 4911 | AbuseStateConstant: |
50e16ccf C |
4912 | properties: |
4913 | id: | |
4f32032f | 4914 | $ref: '#/components/schemas/AbuseStateSet' |
50e16ccf C |
4915 | label: |
4916 | type: string | |
4f32032f | 4917 | AbusePredefinedReasons: |
1ebddadd RK |
4918 | type: array |
4919 | items: | |
4920 | type: string | |
4921 | enum: | |
4922 | - violentOrAbusive | |
4923 | - hatefulOrAbusive | |
4924 | - spamOrMisleading | |
4925 | - privacy | |
4926 | - rights | |
4927 | - serverRules | |
4928 | - thumbnails | |
4929 | - captions | |
84f6e32c | 4930 | example: [spamOrMisleading] |
50e16ccf | 4931 | |
40cfb36b RK |
4932 | VideoResolutionSet: |
4933 | type: integer | |
4934 | description: | | |
4935 | Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) | |
4936 | ||
4937 | `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. | |
4938 | example: 240 | |
5dce26d2 | 4939 | VideoResolutionConstant: |
2c4876f2 | 4940 | description: resolutions and their labels for the video |
5dce26d2 C |
4941 | properties: |
4942 | id: | |
40cfb36b | 4943 | $ref: '#/components/schemas/VideoResolutionSet' |
5dce26d2 C |
4944 | label: |
4945 | type: string | |
84f6e32c | 4946 | example: 240p |
5dce26d2 C |
4947 | VideoScheduledUpdate: |
4948 | properties: | |
4949 | privacy: | |
4950 | $ref: '#/components/schemas/VideoPrivacySet' | |
5dce26d2 C |
4951 | updateAt: |
4952 | type: string | |
4953 | format: date | |
4954 | description: When to update the video | |
4955 | required: | |
4956 | - updateAt | |
c1843150 | 4957 | AccountSummary: |
5dce26d2 C |
4958 | properties: |
4959 | id: | |
06746a8b | 4960 | type: integer |
5dce26d2 C |
4961 | name: |
4962 | type: string | |
4963 | displayName: | |
4964 | type: string | |
4965 | url: | |
4966 | type: string | |
84f6e32c | 4967 | format: url |
5dce26d2 C |
4968 | host: |
4969 | type: string | |
84f6e32c | 4970 | format: hostname |
5dce26d2 C |
4971 | avatar: |
4972 | nullable: true | |
c1843150 | 4973 | allOf: |
75cba40d | 4974 | - $ref: '#/components/schemas/ActorImage' |
5dce26d2 C |
4975 | VideoChannelSummary: |
4976 | properties: | |
4977 | id: | |
b8375da9 | 4978 | $ref: '#/components/schemas/id' |
5dce26d2 C |
4979 | name: |
4980 | type: string | |
4981 | displayName: | |
4982 | type: string | |
4983 | url: | |
4984 | type: string | |
84f6e32c | 4985 | format: url |
5dce26d2 C |
4986 | host: |
4987 | type: string | |
84f6e32c | 4988 | format: hostname |
5dce26d2 C |
4989 | avatar: |
4990 | nullable: true | |
c1843150 | 4991 | allOf: |
75cba40d | 4992 | - $ref: '#/components/schemas/ActorImage' |
5dce26d2 C |
4993 | PlaylistElement: |
4994 | properties: | |
4995 | position: | |
06746a8b | 4996 | type: integer |
5dce26d2 | 4997 | startTimestamp: |
06746a8b | 4998 | type: integer |
c00100b6 | 4999 | format: seconds |
5dce26d2 | 5000 | stopTimestamp: |
06746a8b | 5001 | type: integer |
c00100b6 | 5002 | format: seconds |
bfbd9128 C |
5003 | video: |
5004 | nullable: true | |
c1843150 C |
5005 | allOf: |
5006 | - $ref: '#/components/schemas/Video' | |
5dce26d2 | 5007 | VideoFile: |
2c4876f2 | 5008 | readOnly: true |
5dce26d2 C |
5009 | properties: |
5010 | magnetUri: | |
5011 | type: string | |
2c4876f2 RK |
5012 | format: uri |
5013 | description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file | |
5014 | 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 | |
5015 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i | |
5dce26d2 C |
5016 | resolution: |
5017 | $ref: '#/components/schemas/VideoResolutionConstant' | |
5018 | size: | |
06746a8b | 5019 | type: integer |
2c4876f2 | 5020 | description: Video file size in bytes |
5dce26d2 C |
5021 | torrentUrl: |
5022 | type: string | |
e81af300 | 5023 | description: Direct URL of the torrent file |
84f6e32c | 5024 | format: url |
0ad45af7 | 5025 | torrentDownloadUrl: |
5dce26d2 | 5026 | type: string |
e81af300 | 5027 | description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) |
84f6e32c | 5028 | format: url |
5dce26d2 C |
5029 | fileUrl: |
5030 | type: string | |
e81af300 | 5031 | description: Direct URL of the video |
84f6e32c | 5032 | format: url |
5dce26d2 C |
5033 | fileDownloadUrl: |
5034 | type: string | |
e81af300 | 5035 | description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) |
84f6e32c | 5036 | format: url |
5dce26d2 C |
5037 | fps: |
5038 | type: number | |
2c4876f2 | 5039 | description: Frames per second of the video file |
63748ad0 C |
5040 | metadataUrl: |
5041 | type: string | |
84f6e32c | 5042 | format: url |
2c4876f2 | 5043 | description: URL dereferencing the output of ffprobe on the file |
5dce26d2 | 5044 | VideoStreamingPlaylists: |
4ca669e3 RK |
5045 | allOf: |
5046 | - type: object | |
5047 | properties: | |
5048 | id: | |
b8375da9 | 5049 | $ref: '#/components/schemas/id' |
4ca669e3 RK |
5050 | type: |
5051 | type: integer | |
5052 | enum: | |
5053 | - 1 | |
5054 | description: | | |
5055 | Playlist type: | |
5056 | - `1`: HLS | |
5057 | - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS' | |
5058 | VideoStreamingPlaylists-HLS: | |
5dce26d2 | 5059 | properties: |
5dce26d2 C |
5060 | playlistUrl: |
5061 | type: string | |
84f6e32c | 5062 | format: url |
5dce26d2 C |
5063 | segmentsSha256Url: |
5064 | type: string | |
84f6e32c | 5065 | format: url |
63748ad0 C |
5066 | files: |
5067 | type: array | |
c540d865 RK |
5068 | description: | |
5069 | Video files associated to this playlist. | |
5070 | ||
5071 | 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 |
5072 | items: |
5073 | $ref: '#/components/schemas/VideoFile' | |
5dce26d2 C |
5074 | redundancies: |
5075 | type: array | |
5076 | items: | |
5077 | type: object | |
5078 | properties: | |
5079 | baseUrl: | |
5080 | type: string | |
84f6e32c | 5081 | format: url |
f4d59981 RK |
5082 | VideoInfo: |
5083 | properties: | |
5084 | id: | |
b8375da9 | 5085 | $ref: '#/components/schemas/Video/properties/id' |
f4d59981 | 5086 | uuid: |
b8375da9 | 5087 | $ref: '#/components/schemas/Video/properties/uuid' |
f4d59981 | 5088 | name: |
b8375da9 | 5089 | $ref: '#/components/schemas/Video/properties/name' |
3e9e6f2f RK |
5090 | Video: |
5091 | properties: | |
5092 | id: | |
b8375da9 RK |
5093 | description: object id for the video |
5094 | allOf: | |
5095 | - $ref: '#/components/schemas/id' | |
3e9e6f2f | 5096 | uuid: |
b8375da9 RK |
5097 | description: universal identifier for the video, that can be used across instances |
5098 | allOf: | |
5099 | - $ref: '#/components/schemas/UUIDv4' | |
4e239e35 C |
5100 | isLive: |
5101 | type: boolean | |
3e9e6f2f RK |
5102 | createdAt: |
5103 | type: string | |
84f6e32c | 5104 | format: date-time |
0c114568 RK |
5105 | example: 2017-10-01T10:52:46.396Z |
5106 | description: time at which the video object was first drafted | |
3e9e6f2f RK |
5107 | publishedAt: |
5108 | type: string | |
84f6e32c | 5109 | format: date-time |
0c114568 RK |
5110 | example: 2018-10-01T10:52:46.396Z |
5111 | 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 |
5112 | updatedAt: |
5113 | type: string | |
84f6e32c | 5114 | format: date-time |
0c114568 RK |
5115 | example: 2021-05-04T08:01:01.502Z |
5116 | description: last time the video's metadata was modified | |
5dce26d2 C |
5117 | originallyPublishedAt: |
5118 | type: string | |
84f6e32c | 5119 | format: date-time |
0c114568 RK |
5120 | example: 2010-10-01T10:52:46.396Z |
5121 | description: used to represent a date of first publication, prior to the practical publication date of `publishedAt` | |
3e9e6f2f | 5122 | category: |
b8375da9 RK |
5123 | allOf: |
5124 | - $ref: '#/components/schemas/VideoConstantNumber-Category' | |
5125 | description: category in which the video is classified | |
3e9e6f2f | 5126 | licence: |
b8375da9 RK |
5127 | allOf: |
5128 | - $ref: '#/components/schemas/VideoConstantNumber-Licence' | |
5129 | description: licence under which the video is distributed | |
3e9e6f2f | 5130 | language: |
b8375da9 RK |
5131 | allOf: |
5132 | - $ref: '#/components/schemas/VideoConstantString-Language' | |
5133 | description: main language used in the video | |
3e9e6f2f | 5134 | privacy: |
b8375da9 RK |
5135 | allOf: |
5136 | - $ref: '#/components/schemas/VideoPrivacyConstant' | |
5137 | description: privacy policy used to distribute the video | |
3e9e6f2f RK |
5138 | description: |
5139 | type: string | |
0c114568 RK |
5140 | example: | |
5141 | **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n | |
5142 | **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr... | |
5143 | minLength: 3 | |
5144 | maxLength: 250 | |
5145 | description: | | |
5146 | truncated description of the video, written in Markdown. | |
5147 | Resolve `descriptionPath` to get the full description of maximum `10000` characters. | |
3e9e6f2f | 5148 | duration: |
06746a8b | 5149 | type: integer |
84f6e32c | 5150 | example: 1419 |
c00100b6 | 5151 | format: seconds |
0c114568 | 5152 | description: duration of the video in seconds |
3e9e6f2f RK |
5153 | isLocal: |
5154 | type: boolean | |
5155 | name: | |
5156 | type: string | |
b8375da9 | 5157 | description: title of the video |
84f6e32c | 5158 | example: What is PeerTube? |
bdac0584 RK |
5159 | minLength: 3 |
5160 | maxLength: 120 | |
3e9e6f2f RK |
5161 | thumbnailPath: |
5162 | type: string | |
84f6e32c | 5163 | example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg |
3e9e6f2f RK |
5164 | previewPath: |
5165 | type: string | |
20dcfd74 | 5166 | example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg |
3e9e6f2f RK |
5167 | embedPath: |
5168 | type: string | |
84f6e32c | 5169 | example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee |
3e9e6f2f | 5170 | views: |
06746a8b | 5171 | type: integer |
84f6e32c | 5172 | example: 1337 |
3e9e6f2f | 5173 | likes: |
06746a8b | 5174 | type: integer |
84f6e32c | 5175 | example: 42 |
3e9e6f2f | 5176 | dislikes: |
06746a8b | 5177 | type: integer |
84f6e32c | 5178 | example: 7 |
3e9e6f2f RK |
5179 | nsfw: |
5180 | type: boolean | |
5dce26d2 C |
5181 | waitTranscoding: |
5182 | type: boolean | |
5183 | nullable: true | |
5184 | state: | |
b8375da9 RK |
5185 | allOf: |
5186 | - $ref: '#/components/schemas/VideoStateConstant' | |
5187 | description: represents the internal state of the video processing within the PeerTube instance | |
5dce26d2 C |
5188 | scheduledUpdate: |
5189 | nullable: true | |
c1843150 C |
5190 | allOf: |
5191 | - $ref: '#/components/schemas/VideoScheduledUpdate' | |
5dce26d2 C |
5192 | blacklisted: |
5193 | nullable: true | |
5194 | type: boolean | |
5195 | blacklistedReason: | |
5196 | nullable: true | |
5197 | type: string | |
3e9e6f2f | 5198 | account: |
c1843150 | 5199 | $ref: '#/components/schemas/AccountSummary' |
5dce26d2 C |
5200 | channel: |
5201 | $ref: '#/components/schemas/VideoChannelSummary' | |
5202 | userHistory: | |
5203 | nullable: true | |
3e9e6f2f RK |
5204 | type: object |
5205 | properties: | |
5dce26d2 | 5206 | currentTime: |
06746a8b | 5207 | type: integer |
5dce26d2 C |
5208 | VideoDetails: |
5209 | allOf: | |
5210 | - $ref: '#/components/schemas/Video' | |
5211 | - type: object | |
5212 | properties: | |
5213 | descriptionPath: | |
3e9e6f2f | 5214 | type: string |
0c114568 RK |
5215 | example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description |
5216 | description: path at which to get the full description of maximum `10000` characters | |
5dce26d2 | 5217 | support: |
3e9e6f2f | 5218 | type: string |
00494d6e | 5219 | description: A text tell the audience how to support the video creator |
9a320a06 | 5220 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
c540d865 RK |
5221 | minLength: 3 |
5222 | maxLength: 1000 | |
5dce26d2 C |
5223 | channel: |
5224 | $ref: '#/components/schemas/VideoChannel' | |
5225 | account: | |
5226 | $ref: '#/components/schemas/Account' | |
5227 | tags: | |
bdac0584 | 5228 | example: [flowers, gardening] |
5dce26d2 | 5229 | type: array |
bdac0584 RK |
5230 | minItems: 1 |
5231 | maxItems: 5 | |
5dce26d2 C |
5232 | items: |
5233 | type: string | |
bdac0584 RK |
5234 | minLength: 2 |
5235 | maxLength: 30 | |
5dce26d2 C |
5236 | commentsEnabled: |
5237 | type: boolean | |
5238 | downloadEnabled: | |
5239 | type: boolean | |
5240 | trackerUrls: | |
5241 | type: array | |
5242 | items: | |
5243 | type: string | |
84f6e32c | 5244 | format: url |
2c4876f2 RK |
5245 | example: |
5246 | - https://peertube2.cpy.re/tracker/announce | |
5247 | - wss://peertube2.cpy.re/tracker/socket | |
c540d865 RK |
5248 | files: |
5249 | type: array | |
5250 | items: | |
5251 | $ref: '#/components/schemas/VideoFile' | |
5252 | description: | | |
5253 | WebTorrent/raw video files. If WebTorrent is disabled on the server: | |
5254 | ||
5255 | - field will be empty | |
5256 | - video files will be found in `streamingPlaylists[].files` field | |
5dce26d2 C |
5257 | streamingPlaylists: |
5258 | type: array | |
5259 | items: | |
5260 | $ref: '#/components/schemas/VideoStreamingPlaylists' | |
c540d865 RK |
5261 | description: | |
5262 | HLS playlists/manifest files. If HLS is disabled on the server: | |
5263 | ||
5264 | - field will be empty | |
5265 | - video files will be found in `files` field | |
04b703f6 RK |
5266 | FileRedundancyInformation: |
5267 | properties: | |
5268 | id: | |
b8375da9 | 5269 | $ref: '#/components/schemas/id' |
04b703f6 RK |
5270 | fileUrl: |
5271 | type: string | |
84f6e32c | 5272 | format: url |
04b703f6 RK |
5273 | strategy: |
5274 | type: string | |
84f6e32c RK |
5275 | enum: |
5276 | - manual | |
5277 | - most-views | |
5278 | - trending | |
5279 | - recently-added | |
04b703f6 RK |
5280 | size: |
5281 | type: integer | |
5282 | createdAt: | |
5283 | type: string | |
5284 | format: date-time | |
5285 | updatedAt: | |
5286 | type: string | |
5287 | format: date-time | |
5288 | expiresOn: | |
5289 | type: string | |
5290 | format: date-time | |
5291 | VideoRedundancy: | |
5292 | properties: | |
5293 | id: | |
b8375da9 | 5294 | $ref: '#/components/schemas/id' |
04b703f6 RK |
5295 | name: |
5296 | type: string | |
5297 | url: | |
5298 | type: string | |
84f6e32c | 5299 | format: url |
04b703f6 | 5300 | uuid: |
f880a5e7 | 5301 | $ref: '#/components/schemas/UUIDv4' |
04b703f6 RK |
5302 | redundancies: |
5303 | type: object | |
5304 | properties: | |
5305 | files: | |
5306 | type: array | |
5307 | items: | |
1e904cde | 5308 | $ref: '#/components/schemas/FileRedundancyInformation' |
04b703f6 RK |
5309 | streamingPlaylists: |
5310 | type: array | |
5311 | items: | |
1e904cde | 5312 | $ref: '#/components/schemas/FileRedundancyInformation' |
1f82e3e8 C |
5313 | VideoImportStateConstant: |
5314 | properties: | |
5315 | id: | |
5316 | type: integer | |
5317 | enum: | |
5318 | - 1 | |
5319 | - 2 | |
5320 | - 3 | |
06746a8b | 5321 | description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)' |
1f82e3e8 C |
5322 | label: |
5323 | type: string | |
84f6e32c | 5324 | example: Pending |
ac2a5b54 RK |
5325 | VideoCreateImport: |
5326 | allOf: | |
5327 | - type: object | |
5328 | additionalProperties: false | |
5329 | oneOf: | |
5330 | - properties: | |
5331 | targetUrl: | |
5332 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | |
5333 | required: [targetUrl] | |
5334 | - properties: | |
5335 | magnetUri: | |
5336 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | |
5337 | required: [magnetUri] | |
5338 | - properties: | |
5339 | torrentfile: | |
5340 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | |
5341 | required: [torrentfile] | |
5342 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
5343 | required: | |
5344 | - channelId | |
5345 | - name | |
1f82e3e8 C |
5346 | VideoImport: |
5347 | properties: | |
5348 | id: | |
ac2a5b54 RK |
5349 | readOnly: true |
5350 | allOf: | |
5351 | - $ref: '#/components/schemas/id' | |
1f82e3e8 C |
5352 | targetUrl: |
5353 | type: string | |
84f6e32c | 5354 | format: url |
2c4876f2 | 5355 | description: remote URL where to find the import's source video |
84f6e32c | 5356 | example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d |
1f82e3e8 C |
5357 | magnetUri: |
5358 | type: string | |
84f6e32c | 5359 | format: uri |
2c4876f2 | 5360 | description: magnet URI allowing to resolve the import's source video |
84f6e32c | 5361 | 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 | 5362 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i |
ac2a5b54 RK |
5363 | torrentfile: |
5364 | writeOnly: true | |
5365 | type: string | |
5366 | format: binary | |
5367 | description: Torrent file containing only the video file | |
1f82e3e8 | 5368 | torrentName: |
ac2a5b54 | 5369 | readOnly: true |
1f82e3e8 C |
5370 | type: string |
5371 | state: | |
ac2a5b54 RK |
5372 | readOnly: true |
5373 | allOf: | |
5374 | - $ref: '#/components/schemas/VideoImportStateConstant' | |
1f82e3e8 | 5375 | error: |
ac2a5b54 | 5376 | readOnly: true |
1f82e3e8 C |
5377 | type: string |
5378 | createdAt: | |
ac2a5b54 | 5379 | readOnly: true |
1f82e3e8 | 5380 | type: string |
84f6e32c | 5381 | format: date-time |
1f82e3e8 | 5382 | updatedAt: |
ac2a5b54 | 5383 | readOnly: true |
1f82e3e8 | 5384 | type: string |
84f6e32c | 5385 | format: date-time |
1f82e3e8 | 5386 | video: |
ac2a5b54 | 5387 | readOnly: true |
2c4876f2 RK |
5388 | nullable: true |
5389 | allOf: | |
5390 | - $ref: '#/components/schemas/Video' | |
5844dde3 RK |
5391 | VideoImportsList: |
5392 | properties: | |
5393 | total: | |
5394 | type: integer | |
5395 | example: 1 | |
5396 | data: | |
5397 | type: array | |
5398 | maxItems: 100 | |
5399 | items: | |
5400 | $ref: '#/components/schemas/VideoImport' | |
668b7f09 | 5401 | Abuse: |
3e9e6f2f RK |
5402 | properties: |
5403 | id: | |
b8375da9 | 5404 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5405 | reason: |
5406 | type: string | |
84f6e32c | 5407 | example: The video is a spam |
4302058c RK |
5408 | minLength: 2 |
5409 | maxLength: 3000 | |
1ebddadd | 5410 | predefinedReasons: |
4f32032f | 5411 | $ref: '#/components/schemas/AbusePredefinedReasons' |
3e9e6f2f RK |
5412 | reporterAccount: |
5413 | $ref: '#/components/schemas/Account' | |
50e16ccf | 5414 | state: |
4f32032f | 5415 | $ref: '#/components/schemas/AbuseStateConstant' |
50e16ccf C |
5416 | moderationComment: |
5417 | type: string | |
84f6e32c | 5418 | example: Decided to ban the server since it spams us regularly |
4302058c RK |
5419 | minLength: 2 |
5420 | maxLength: 3000 | |
3e9e6f2f | 5421 | video: |
bdac0584 | 5422 | $ref: '#/components/schemas/VideoInfo' |
3e9e6f2f RK |
5423 | createdAt: |
5424 | type: string | |
84f6e32c | 5425 | format: date-time |
668b7f09 C |
5426 | AbuseMessage: |
5427 | properties: | |
5428 | id: | |
b8375da9 | 5429 | $ref: '#/components/schemas/id' |
668b7f09 C |
5430 | message: |
5431 | type: string | |
4302058c | 5432 | minLength: 2 |
f6d6e7f8 | 5433 | maxLength: 3000 |
668b7f09 C |
5434 | byModerator: |
5435 | type: boolean | |
5436 | createdAt: | |
5437 | type: string | |
5438 | format: date-time | |
5439 | account: | |
5440 | $ref: '#/components/schemas/AccountSummary' | |
3e9e6f2f RK |
5441 | VideoBlacklist: |
5442 | properties: | |
5443 | id: | |
b8375da9 | 5444 | $ref: '#/components/schemas/id' |
3e9e6f2f | 5445 | videoId: |
b8375da9 | 5446 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f RK |
5447 | createdAt: |
5448 | type: string | |
84f6e32c | 5449 | format: date-time |
3e9e6f2f RK |
5450 | updatedAt: |
5451 | type: string | |
84f6e32c | 5452 | format: date-time |
3e9e6f2f RK |
5453 | name: |
5454 | type: string | |
4302058c RK |
5455 | minLength: 3 |
5456 | maxLength: 120 | |
3e9e6f2f | 5457 | uuid: |
f880a5e7 | 5458 | $ref: '#/components/schemas/UUIDv4' |
3e9e6f2f RK |
5459 | description: |
5460 | type: string | |
4302058c RK |
5461 | minLength: 3 |
5462 | maxLength: 10000 | |
3e9e6f2f | 5463 | duration: |
06746a8b | 5464 | type: integer |
3e9e6f2f | 5465 | views: |
06746a8b | 5466 | type: integer |
3e9e6f2f | 5467 | likes: |
06746a8b | 5468 | type: integer |
3e9e6f2f | 5469 | dislikes: |
06746a8b | 5470 | type: integer |
3e9e6f2f RK |
5471 | nsfw: |
5472 | type: boolean | |
71810d0b RK |
5473 | VideoPlaylist: |
5474 | properties: | |
5475 | id: | |
b8375da9 RK |
5476 | $ref: '#/components/schemas/id' |
5477 | uuid: | |
5478 | $ref: '#/components/schemas/UUIDv4' | |
71810d0b RK |
5479 | createdAt: |
5480 | type: string | |
84f6e32c | 5481 | format: date-time |
71810d0b RK |
5482 | updatedAt: |
5483 | type: string | |
84f6e32c | 5484 | format: date-time |
71810d0b RK |
5485 | description: |
5486 | type: string | |
4302058c RK |
5487 | minLength: 3 |
5488 | maxLength: 1000 | |
71810d0b RK |
5489 | displayName: |
5490 | type: string | |
4302058c RK |
5491 | minLength: 1 |
5492 | maxLength: 120 | |
71810d0b RK |
5493 | isLocal: |
5494 | type: boolean | |
5495 | videoLength: | |
06746a8b | 5496 | type: integer |
b8375da9 | 5497 | minimum: 0 |
71810d0b RK |
5498 | thumbnailPath: |
5499 | type: string | |
5500 | privacy: | |
c1843150 | 5501 | $ref: '#/components/schemas/VideoPlaylistPrivacyConstant' |
71810d0b | 5502 | type: |
c1843150 | 5503 | $ref: '#/components/schemas/VideoPlaylistTypeConstant' |
71810d0b | 5504 | ownerAccount: |
c1843150 C |
5505 | $ref: '#/components/schemas/AccountSummary' |
5506 | videoChannel: | |
5507 | $ref: '#/components/schemas/VideoChannelSummary' | |
3e9e6f2f RK |
5508 | VideoComment: |
5509 | properties: | |
5510 | id: | |
b8375da9 | 5511 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5512 | url: |
5513 | type: string | |
84f6e32c | 5514 | format: url |
3e9e6f2f RK |
5515 | text: |
5516 | type: string | |
bf3c3fea RK |
5517 | format: html |
5518 | description: Text of the comment | |
4302058c | 5519 | minLength: 1 |
bf3c3fea | 5520 | example: This video is wonderful! |
3e9e6f2f | 5521 | threadId: |
b8375da9 | 5522 | $ref: '#/components/schemas/id' |
bf3c3fea RK |
5523 | inReplyToCommentId: |
5524 | nullable: true | |
5525 | allOf: | |
5526 | - $ref: '#/components/schemas/id' | |
3e9e6f2f | 5527 | videoId: |
b8375da9 | 5528 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f RK |
5529 | createdAt: |
5530 | type: string | |
84f6e32c | 5531 | format: date-time |
3e9e6f2f RK |
5532 | updatedAt: |
5533 | type: string | |
84f6e32c | 5534 | format: date-time |
bf3c3fea RK |
5535 | deletedAt: |
5536 | nullable: true | |
5537 | type: string | |
5538 | format: date-time | |
5539 | default: null | |
5540 | isDeleted: | |
5541 | type: boolean | |
5542 | default: false | |
5b0413dd | 5543 | totalRepliesFromVideoAuthor: |
06746a8b | 5544 | type: integer |
b8375da9 | 5545 | minimum: 0 |
3e9e6f2f | 5546 | totalReplies: |
06746a8b | 5547 | type: integer |
b8375da9 | 5548 | minimum: 0 |
3e9e6f2f RK |
5549 | account: |
5550 | $ref: '#/components/schemas/Account' | |
5551 | VideoCommentThreadTree: | |
5552 | properties: | |
5553 | comment: | |
5554 | $ref: '#/components/schemas/VideoComment' | |
5555 | children: | |
5556 | type: array | |
5557 | items: | |
5558 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
67ae04a5 C |
5559 | VideoCaption: |
5560 | properties: | |
5561 | language: | |
dfcb6f50 | 5562 | $ref: '#/components/schemas/VideoConstantString-Language' |
67ae04a5 C |
5563 | captionPath: |
5564 | type: string | |
75cba40d | 5565 | ActorImage: |
3e9e6f2f RK |
5566 | properties: |
5567 | path: | |
5568 | type: string | |
5569 | createdAt: | |
5570 | type: string | |
84f6e32c | 5571 | format: date-time |
3e9e6f2f RK |
5572 | updatedAt: |
5573 | type: string | |
84f6e32c | 5574 | format: date-time |
f4d59981 RK |
5575 | ActorInfo: |
5576 | properties: | |
5577 | id: | |
b8375da9 | 5578 | $ref: '#/components/schemas/id' |
f4d59981 RK |
5579 | name: |
5580 | type: string | |
5581 | displayName: | |
5582 | type: string | |
5583 | host: | |
5584 | type: string | |
84f6e32c | 5585 | format: hostname |
f4d59981 RK |
5586 | avatar: |
5587 | nullable: true | |
5588 | type: object | |
5589 | properties: | |
5590 | path: | |
5591 | type: string | |
3e9e6f2f RK |
5592 | Actor: |
5593 | properties: | |
5594 | id: | |
b8375da9 | 5595 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5596 | url: |
5597 | type: string | |
84f6e32c | 5598 | format: url |
3e9e6f2f | 5599 | name: |
77b0c6b5 | 5600 | description: immutable name of the actor, used to find or mention it |
2c4876f2 RK |
5601 | allOf: |
5602 | - $ref: '#/components/schemas/username' | |
3e9e6f2f RK |
5603 | host: |
5604 | type: string | |
84f6e32c | 5605 | format: hostname |
2c4876f2 | 5606 | description: server on which the actor is resident |
045bcd0d RK |
5607 | hostRedundancyAllowed: |
5608 | type: boolean | |
2c4876f2 | 5609 | description: whether this actor's host allows redundancy of its videos |
3e9e6f2f | 5610 | followingCount: |
06746a8b | 5611 | type: integer |
2c4876f2 RK |
5612 | minimum: 0 |
5613 | description: number of actors subscribed to by this actor, as seen by this instance | |
3e9e6f2f | 5614 | followersCount: |
06746a8b | 5615 | type: integer |
2c4876f2 RK |
5616 | minimum: 0 |
5617 | description: number of followers of this actor, as seen by this instance | |
3e9e6f2f RK |
5618 | createdAt: |
5619 | type: string | |
84f6e32c | 5620 | format: date-time |
3e9e6f2f RK |
5621 | updatedAt: |
5622 | type: string | |
84f6e32c | 5623 | format: date-time |
3e9e6f2f | 5624 | avatar: |
75cba40d | 5625 | $ref: '#/components/schemas/ActorImage' |
3e9e6f2f RK |
5626 | Account: |
5627 | allOf: | |
5628 | - $ref: '#/components/schemas/Actor' | |
5629 | - properties: | |
2a8ae759 | 5630 | userId: |
2c4876f2 RK |
5631 | description: object id for the user tied to this account |
5632 | allOf: | |
5633 | - $ref: '#/components/schemas/User/properties/id' | |
3e9e6f2f RK |
5634 | displayName: |
5635 | type: string | |
77b0c6b5 RK |
5636 | description: editable name of the account, displayed in its representations |
5637 | minLength: 3 | |
5638 | maxLength: 120 | |
2a8ae759 FS |
5639 | description: |
5640 | type: string | |
2c4876f2 | 5641 | description: text or bio displayed on the account's profile |
6441981b RK |
5642 | UserWatchingVideo: |
5643 | properties: | |
5644 | currentTime: | |
06746a8b | 5645 | type: integer |
c00100b6 | 5646 | format: seconds |
84f6e32c RK |
5647 | description: timestamp within the video, in seconds |
5648 | example: 5 | |
3e9e6f2f RK |
5649 | ServerConfig: |
5650 | properties: | |
2a8ae759 FS |
5651 | instance: |
5652 | type: object | |
5653 | properties: | |
5654 | name: | |
5655 | type: string | |
5656 | shortDescription: | |
5657 | type: string | |
5658 | defaultClientRoute: | |
5659 | type: string | |
5660 | isNSFW: | |
5661 | type: boolean | |
5662 | defaultNSFWPolicy: | |
5663 | type: string | |
5664 | customizations: | |
5665 | type: object | |
5666 | properties: | |
5667 | javascript: | |
5668 | type: string | |
5669 | css: | |
5670 | type: string | |
f30736c8 RK |
5671 | search: |
5672 | type: object | |
5673 | properties: | |
5674 | remoteUri: | |
5675 | type: object | |
5676 | properties: | |
5677 | users: | |
5678 | type: boolean | |
5679 | anonymous: | |
5680 | type: boolean | |
2a8ae759 FS |
5681 | plugin: |
5682 | type: object | |
5683 | properties: | |
5684 | registered: | |
5685 | type: array | |
5686 | items: | |
5687 | type: string | |
5688 | theme: | |
5689 | type: object | |
5690 | properties: | |
5691 | registered: | |
5692 | type: array | |
5693 | items: | |
5694 | type: string | |
5695 | email: | |
5696 | type: object | |
5697 | properties: | |
5698 | enabled: | |
5699 | type: boolean | |
5700 | contactForm: | |
5701 | type: object | |
5702 | properties: | |
5703 | enabled: | |
5704 | type: boolean | |
5705 | serverVersion: | |
5706 | type: string | |
5707 | serverCommit: | |
5708 | type: string | |
3e9e6f2f RK |
5709 | signup: |
5710 | type: object | |
5711 | properties: | |
5712 | allowed: | |
5713 | type: boolean | |
2a8ae759 FS |
5714 | allowedForCurrentIP: |
5715 | type: boolean | |
5716 | requiresEmailVerification: | |
5717 | type: boolean | |
3e9e6f2f RK |
5718 | transcoding: |
5719 | type: object | |
5720 | properties: | |
2a8ae759 FS |
5721 | hls: |
5722 | type: object | |
5723 | properties: | |
5724 | enabled: | |
5725 | type: boolean | |
f30736c8 RK |
5726 | webtorrent: |
5727 | type: object | |
5728 | properties: | |
5729 | enabled: | |
5730 | type: boolean | |
3e9e6f2f RK |
5731 | enabledResolutions: |
5732 | type: array | |
5733 | items: | |
40cfb36b | 5734 | $ref: '#/components/schemas/VideoResolutionSet' |
2a8ae759 FS |
5735 | import: |
5736 | type: object | |
5737 | properties: | |
5738 | videos: | |
5739 | type: object | |
5740 | properties: | |
5741 | http: | |
5742 | type: object | |
5743 | properties: | |
5744 | enabled: | |
5745 | type: boolean | |
5746 | torrent: | |
5747 | type: object | |
5748 | properties: | |
5749 | enabled: | |
5750 | type: boolean | |
5751 | autoBlacklist: | |
5752 | type: object | |
5753 | properties: | |
5754 | videos: | |
5755 | type: object | |
5756 | properties: | |
5757 | ofUsers: | |
5758 | type: object | |
5759 | properties: | |
5760 | enabled: | |
5761 | type: boolean | |
3e9e6f2f RK |
5762 | avatar: |
5763 | type: object | |
5764 | properties: | |
5765 | file: | |
5766 | type: object | |
5767 | properties: | |
5768 | size: | |
5769 | type: object | |
5770 | properties: | |
5771 | max: | |
06746a8b | 5772 | type: integer |
3e9e6f2f RK |
5773 | extensions: |
5774 | type: array | |
5775 | items: | |
5776 | type: string | |
5777 | video: | |
5778 | type: object | |
5779 | properties: | |
2a8ae759 FS |
5780 | image: |
5781 | type: object | |
5782 | properties: | |
5783 | extensions: | |
5784 | type: array | |
5785 | items: | |
5786 | type: string | |
5787 | size: | |
5788 | type: object | |
5789 | properties: | |
5790 | max: | |
06746a8b | 5791 | type: integer |
3e9e6f2f RK |
5792 | file: |
5793 | type: object | |
5794 | properties: | |
5795 | extensions: | |
5796 | type: array | |
5797 | items: | |
5798 | type: string | |
2a8ae759 FS |
5799 | videoCaption: |
5800 | type: object | |
5801 | properties: | |
5802 | file: | |
5803 | type: object | |
5804 | properties: | |
5805 | size: | |
5806 | type: object | |
5807 | properties: | |
5808 | max: | |
06746a8b | 5809 | type: integer |
2a8ae759 FS |
5810 | extensions: |
5811 | type: array | |
5812 | items: | |
5813 | type: string | |
5814 | user: | |
5815 | type: object | |
5816 | properties: | |
5817 | videoQuota: | |
06746a8b | 5818 | type: integer |
b8375da9 | 5819 | example: 16810141515 |
2a8ae759 | 5820 | videoQuotaDaily: |
06746a8b | 5821 | type: integer |
b8375da9 | 5822 | example: 1681014151 |
2a8ae759 FS |
5823 | trending: |
5824 | type: object | |
5825 | properties: | |
5826 | videos: | |
5827 | type: object | |
5828 | properties: | |
5829 | intervalDays: | |
06746a8b | 5830 | type: integer |
2a8ae759 | 5831 | tracker: |
747b17c7 | 5832 | type: object |
2a8ae759 FS |
5833 | properties: |
5834 | enabled: | |
5835 | type: boolean | |
f30736c8 RK |
5836 | followings: |
5837 | type: object | |
5838 | properties: | |
5839 | instance: | |
5840 | type: object | |
5841 | properties: | |
5842 | autoFollowIndex: | |
5843 | type: object | |
5844 | properties: | |
5845 | indexUrl: | |
5846 | type: string | |
84f6e32c | 5847 | format: url |
2539932e C |
5848 | homepage: |
5849 | type: object | |
5850 | properties: | |
5851 | enabled: | |
5852 | type: boolean | |
5853 | ||
2a8ae759 FS |
5854 | ServerConfigAbout: |
5855 | properties: | |
5856 | instance: | |
5857 | type: object | |
5858 | properties: | |
5859 | name: | |
5860 | type: string | |
5861 | shortDescription: | |
5862 | type: string | |
5863 | description: | |
5864 | type: string | |
5865 | terms: | |
5866 | type: string | |
5867 | ServerConfigCustom: | |
5868 | properties: | |
5869 | instance: | |
5870 | type: object | |
5871 | properties: | |
5872 | name: | |
5873 | type: string | |
5874 | shortDescription: | |
5875 | type: string | |
5876 | description: | |
5877 | type: string | |
5878 | terms: | |
5879 | type: string | |
5880 | defaultClientRoute: | |
5881 | type: string | |
5882 | isNSFW: | |
5883 | type: boolean | |
5884 | defaultNSFWPolicy: | |
5885 | type: string | |
5886 | customizations: | |
5887 | type: object | |
5888 | properties: | |
5889 | javascript: | |
5890 | type: string | |
5891 | css: | |
5892 | type: string | |
5893 | theme: | |
5894 | type: object | |
5895 | properties: | |
5896 | default: | |
5897 | type: string | |
5898 | services: | |
5899 | type: object | |
5900 | properties: | |
5901 | twitter: | |
5902 | type: object | |
5903 | properties: | |
5904 | username: | |
5905 | type: string | |
5906 | whitelisted: | |
5907 | type: boolean | |
5908 | cache: | |
5909 | type: object | |
5910 | properties: | |
5911 | previews: | |
5912 | type: object | |
5913 | properties: | |
5914 | size: | |
06746a8b | 5915 | type: integer |
2a8ae759 FS |
5916 | captions: |
5917 | type: object | |
5918 | properties: | |
5919 | size: | |
06746a8b | 5920 | type: integer |
2a8ae759 FS |
5921 | signup: |
5922 | type: object | |
5923 | properties: | |
5924 | enabled: | |
5925 | type: boolean | |
5926 | limit: | |
06746a8b | 5927 | type: integer |
2a8ae759 FS |
5928 | requiresEmailVerification: |
5929 | type: boolean | |
5930 | admin: | |
5931 | type: object | |
5932 | properties: | |
5933 | email: | |
5934 | type: string | |
84f6e32c | 5935 | format: email |
2a8ae759 FS |
5936 | contactForm: |
5937 | type: object | |
5938 | properties: | |
5939 | enabled: | |
5940 | type: boolean | |
5941 | user: | |
5942 | type: object | |
40cfb36b | 5943 | description: Settings that apply to new users, if registration is enabled |
2a8ae759 FS |
5944 | properties: |
5945 | videoQuota: | |
06746a8b | 5946 | type: integer |
b8375da9 | 5947 | example: 16810141515 |
2a8ae759 | 5948 | videoQuotaDaily: |
06746a8b | 5949 | type: integer |
b8375da9 | 5950 | example: 1681014151 |
2a8ae759 FS |
5951 | transcoding: |
5952 | type: object | |
40cfb36b | 5953 | description: Settings pertaining to transcoding jobs |
2a8ae759 FS |
5954 | properties: |
5955 | enabled: | |
5956 | type: boolean | |
5957 | allowAdditionalExtensions: | |
5958 | type: boolean | |
40cfb36b | 5959 | description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos |
2a8ae759 FS |
5960 | allowAudioFiles: |
5961 | type: boolean | |
40cfb36b | 5962 | description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file |
2a8ae759 | 5963 | threads: |
06746a8b | 5964 | type: integer |
40cfb36b RK |
5965 | description: Amount of threads used by ffmpeg for 1 transcoding job |
5966 | concurrency: | |
5967 | type: number | |
5968 | description: Amount of transcoding jobs to execute in parallel | |
5969 | profile: | |
5970 | type: string | |
5971 | enum: | |
5972 | - default | |
5973 | description: | | |
5974 | New profiles can be added by plugins ; available in core PeerTube: 'default'. | |
2a8ae759 FS |
5975 | resolutions: |
5976 | type: object | |
40cfb36b | 5977 | description: Resolutions to transcode _new videos_ to |
2a8ae759 | 5978 | properties: |
40cfb36b RK |
5979 | 0p: |
5980 | type: boolean | |
2a8ae759 FS |
5981 | 240p: |
5982 | type: boolean | |
5983 | 360p: | |
5984 | type: boolean | |
5985 | 480p: | |
5986 | type: boolean | |
5987 | 720p: | |
5988 | type: boolean | |
5989 | 1080p: | |
5990 | type: boolean | |
b7085c71 RK |
5991 | 1440p: |
5992 | type: boolean | |
2a8ae759 FS |
5993 | 2160p: |
5994 | type: boolean | |
40cfb36b RK |
5995 | webtorrent: |
5996 | type: object | |
5997 | description: WebTorrent-specific settings | |
5998 | properties: | |
5999 | enabled: | |
6000 | type: boolean | |
2a8ae759 FS |
6001 | hls: |
6002 | type: object | |
40cfb36b | 6003 | description: HLS-specific settings |
2a8ae759 FS |
6004 | properties: |
6005 | enabled: | |
6006 | type: boolean | |
6007 | import: | |
6008 | type: object | |
6009 | properties: | |
6010 | videos: | |
6011 | type: object | |
6012 | properties: | |
6013 | http: | |
6014 | type: object | |
6015 | properties: | |
6016 | enabled: | |
6017 | type: boolean | |
6018 | torrent: | |
6019 | type: object | |
6020 | properties: | |
6021 | enabled: | |
6022 | type: boolean | |
6023 | autoBlacklist: | |
6024 | type: object | |
6025 | properties: | |
6026 | videos: | |
6027 | type: object | |
6028 | properties: | |
6029 | ofUsers: | |
6030 | type: object | |
6031 | properties: | |
6032 | enabled: | |
6033 | type: boolean | |
6034 | followers: | |
6035 | type: object | |
6036 | properties: | |
6037 | instance: | |
6038 | type: object | |
6039 | properties: | |
6040 | enabled: | |
6041 | type: boolean | |
6042 | manualApproval: | |
6043 | type: boolean | |
2539932e C |
6044 | |
6045 | CustomHomepage: | |
6046 | properties: | |
6047 | content: | |
6048 | type: string | |
6049 | ||
3e9e6f2f RK |
6050 | Follow: |
6051 | properties: | |
6052 | id: | |
b8375da9 | 6053 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
6054 | follower: |
6055 | $ref: '#/components/schemas/Actor' | |
6056 | following: | |
6057 | $ref: '#/components/schemas/Actor' | |
6058 | score: | |
6059 | type: number | |
04b703f6 | 6060 | description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. |
3e9e6f2f RK |
6061 | state: |
6062 | type: string | |
6063 | enum: | |
6064 | - pending | |
6065 | - accepted | |
6066 | createdAt: | |
6067 | type: string | |
84f6e32c | 6068 | format: date-time |
3e9e6f2f RK |
6069 | updatedAt: |
6070 | type: string | |
84f6e32c | 6071 | format: date-time |
e3489df9 C |
6072 | |
6073 | PredefinedAbuseReasons: | |
6074 | description: Reason categories that help triage reports | |
6075 | type: array | |
f6d6e7f8 | 6076 | maxItems: 8 |
e3489df9 C |
6077 | items: |
6078 | type: string | |
6079 | enum: | |
6080 | - violentOrAbusive | |
6081 | - hatefulOrAbusive | |
6082 | - spamOrMisleading | |
6083 | - privacy | |
6084 | - rights | |
6085 | - serverRules | |
6086 | - thumbnails | |
6087 | - captions | |
6088 | ||
3e9e6f2f RK |
6089 | Job: |
6090 | properties: | |
6091 | id: | |
b8375da9 | 6092 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
6093 | state: |
6094 | type: string | |
6095 | enum: | |
84f6e32c RK |
6096 | - active |
6097 | - completed | |
6098 | - failed | |
6099 | - waiting | |
6100 | - delayed | |
6101 | type: | |
3e9e6f2f RK |
6102 | type: string |
6103 | enum: | |
84f6e32c RK |
6104 | - activitypub-http-unicast |
6105 | - activitypub-http-broadcast | |
6106 | - activitypub-http-fetcher | |
6107 | - activitypub-follow | |
6108 | - video-file-import | |
6109 | - video-transcoding | |
6110 | ||
6111 | - video-import | |
6112 | - videos-views | |
6113 | - activitypub-refresher | |
6114 | - video-redundancy | |
6115 | data: | |
6116 | type: object | |
6117 | additionalProperties: true | |
6118 | error: | |
6119 | type: object | |
6120 | additionalProperties: true | |
3e9e6f2f RK |
6121 | createdAt: |
6122 | type: string | |
84f6e32c RK |
6123 | format: date-time |
6124 | finishedOn: | |
3e9e6f2f | 6125 | type: string |
84f6e32c RK |
6126 | format: date-time |
6127 | processedOn: | |
6128 | type: string | |
6129 | format: date-time | |
3e9e6f2f RK |
6130 | AddUserResponse: |
6131 | properties: | |
2c318664 RK |
6132 | user: |
6133 | type: object | |
6134 | properties: | |
6135 | id: | |
b8375da9 | 6136 | $ref: '#/components/schemas/id' |
2c318664 RK |
6137 | account: |
6138 | type: object | |
6139 | properties: | |
6140 | id: | |
b8375da9 | 6141 | $ref: '#/components/schemas/id' |
f6d6e7f8 | 6142 | VideoUploadRequestCommon: |
6143 | properties: | |
6144 | name: | |
6145 | description: Video name | |
6146 | type: string | |
b8375da9 RK |
6147 | example: What is PeerTube? |
6148 | minLength: 3 | |
6149 | maxLength: 120 | |
f6d6e7f8 | 6150 | channelId: |
6151 | description: Channel id that will contain this video | |
6152 | type: integer | |
b8375da9 RK |
6153 | example: 3 |
6154 | minimum: 1 | |
f6d6e7f8 | 6155 | privacy: |
6156 | $ref: '#/components/schemas/VideoPrivacySet' | |
6157 | category: | |
40cfb36b | 6158 | $ref: '#/components/schemas/VideoCategorySet' |
f6d6e7f8 | 6159 | licence: |
40cfb36b | 6160 | $ref: '#/components/schemas/VideoLicenceSet' |
f6d6e7f8 | 6161 | language: |
40cfb36b | 6162 | $ref: '#/components/schemas/VideoLanguageSet' |
f6d6e7f8 | 6163 | description: |
6164 | description: Video description | |
6165 | type: string | |
b8375da9 RK |
6166 | example: | |
6167 | **[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 | 6168 | waitTranscoding: |
6169 | description: Whether or not we wait transcoding before publish the video | |
6170 | type: boolean | |
6171 | support: | |
6172 | description: A text tell the audience how to support the video creator | |
9a320a06 | 6173 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
f6d6e7f8 | 6174 | type: string |
6175 | nsfw: | |
6176 | description: Whether or not this video contains sensitive content | |
6177 | type: boolean | |
6178 | tags: | |
6179 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
6180 | type: array | |
6181 | minItems: 1 | |
6182 | maxItems: 5 | |
6183 | uniqueItems: true | |
b8375da9 RK |
6184 | example: |
6185 | - framasoft | |
6186 | - peertube | |
f6d6e7f8 | 6187 | items: |
6188 | type: string | |
6189 | minLength: 2 | |
6190 | maxLength: 30 | |
6191 | commentsEnabled: | |
6192 | description: Enable or disable comments for this video | |
6193 | type: boolean | |
6194 | downloadEnabled: | |
6195 | description: Enable or disable downloading for this video | |
6196 | type: boolean | |
6197 | originallyPublishedAt: | |
6198 | description: Date when the content was originally published | |
6199 | type: string | |
6200 | format: date-time | |
6201 | scheduleUpdate: | |
6202 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
6203 | thumbnailfile: | |
6204 | description: Video thumbnail file | |
6205 | type: string | |
6206 | format: binary | |
6207 | previewfile: | |
6208 | description: Video preview file | |
6209 | type: string | |
6210 | format: binary | |
6211 | required: | |
6212 | - channelId | |
6213 | - name | |
6214 | VideoUploadRequestLegacy: | |
6215 | allOf: | |
6216 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6217 | - type: object | |
6218 | required: | |
6219 | - videofile | |
6220 | properties: | |
6221 | videofile: | |
6222 | description: Video file | |
6223 | type: string | |
6224 | format: binary | |
6225 | VideoUploadRequestResumable: | |
6226 | allOf: | |
6227 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6228 | - type: object | |
6229 | required: | |
6230 | - filename | |
6231 | properties: | |
6232 | filename: | |
6233 | description: Video filename including extension | |
6234 | type: string | |
6235 | format: filename | |
b8375da9 | 6236 | example: what_is_peertube.mp4 |
f6d6e7f8 | 6237 | thumbnailfile: |
6238 | description: Video thumbnail file | |
6239 | type: string | |
6240 | format: binary | |
6241 | previewfile: | |
6242 | description: Video preview file | |
6243 | type: string | |
6244 | format: binary | |
3e9e6f2f RK |
6245 | VideoUploadResponse: |
6246 | properties: | |
6247 | video: | |
6248 | type: object | |
6249 | properties: | |
6250 | id: | |
b8375da9 | 6251 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f | 6252 | uuid: |
b8375da9 | 6253 | $ref: '#/components/schemas/Video/properties/uuid' |
3e9e6f2f RK |
6254 | CommentThreadResponse: |
6255 | properties: | |
6256 | total: | |
06746a8b | 6257 | type: integer |
84f6e32c | 6258 | example: 1 |
3e9e6f2f RK |
6259 | data: |
6260 | type: array | |
84f6e32c | 6261 | maxItems: 100 |
3e9e6f2f RK |
6262 | items: |
6263 | $ref: '#/components/schemas/VideoComment' | |
6264 | CommentThreadPostResponse: | |
6265 | properties: | |
6266 | comment: | |
6267 | $ref: '#/components/schemas/VideoComment' | |
048b6946 C |
6268 | VideoListResponse: |
6269 | properties: | |
6270 | total: | |
06746a8b | 6271 | type: integer |
84f6e32c | 6272 | example: 1 |
048b6946 C |
6273 | data: |
6274 | type: array | |
84f6e32c | 6275 | maxItems: 100 |
048b6946 C |
6276 | items: |
6277 | $ref: '#/components/schemas/Video' | |
84f6e32c RK |
6278 | User: |
6279 | properties: | |
fd5586b3 RK |
6280 | account: |
6281 | $ref: '#/components/schemas/Account' | |
6282 | autoPlayNextVideo: | |
6283 | type: boolean | |
6284 | description: Automatically start playing the upcoming video after the currently playing video | |
6285 | autoPlayNextVideoPlaylist: | |
6286 | type: boolean | |
6287 | description: Automatically start playing the video on the playlist after the currently playing video | |
6288 | autoPlayVideo: | |
6289 | type: boolean | |
6290 | description: Automatically start playing the video on the watch page | |
6291 | blocked: | |
6292 | type: boolean | |
6293 | blockedReason: | |
6294 | type: string | |
6295 | createdAt: | |
84f6e32c | 6296 | type: string |
84f6e32c RK |
6297 | email: |
6298 | type: string | |
6299 | format: email | |
6300 | description: The user email | |
fd5586b3 RK |
6301 | emailVerified: |
6302 | type: boolean | |
6303 | description: Has the user confirmed their email address? | |
6304 | id: | |
2c4876f2 RK |
6305 | allOf: |
6306 | - $ref: '#/components/schemas/id' | |
fd5586b3 | 6307 | readOnly: true |
6d989edc C |
6308 | pluginAuth: |
6309 | type: string | |
6310 | description: Auth plugin to use to authenticate the user | |
fd5586b3 | 6311 | lastLoginDate: |
84f6e32c | 6312 | type: string |
fd5586b3 RK |
6313 | format: date-time |
6314 | noInstanceConfigWarningModal: | |
6315 | type: boolean | |
6316 | noWelcomeModal: | |
84f6e32c | 6317 | type: boolean |
84f6e32c RK |
6318 | nsfwPolicy: |
6319 | $ref: '#/components/schemas/NSFWPolicy' | |
84f6e32c RK |
6320 | role: |
6321 | $ref: '#/components/schemas/UserRole' | |
6322 | roleLabel: | |
6323 | type: string | |
6324 | enum: | |
6325 | - User | |
6326 | - Moderator | |
6327 | - Administrator | |
fd5586b3 | 6328 | theme: |
84f6e32c | 6329 | type: string |
fd5586b3 RK |
6330 | description: Theme enabled by this user |
6331 | username: | |
b8375da9 | 6332 | $ref: '#/components/schemas/username' |
84f6e32c RK |
6333 | videoChannels: |
6334 | type: array | |
6335 | items: | |
6336 | $ref: '#/components/schemas/VideoChannel' | |
fd5586b3 RK |
6337 | videoQuota: |
6338 | type: integer | |
6339 | description: The user video quota in bytes | |
6340 | example: -1 | |
6341 | videoQuotaDaily: | |
6342 | type: integer | |
6343 | description: The user daily video quota in bytes | |
6344 | example: -1 | |
6345 | webtorrentEnabled: | |
6346 | type: boolean | |
6347 | description: Enable P2P in the player | |
6348 | UserWithStats: | |
6349 | allOf: | |
6350 | - $ref: '#/components/schemas/User' | |
6351 | - properties: | |
6352 | # optionally present fields: they require WITH_STATS scope | |
6353 | videosCount: | |
6354 | type: integer | |
85a60d8b | 6355 | description: Count of videos published |
fd5586b3 RK |
6356 | abusesCount: |
6357 | type: integer | |
6358 | description: Count of reports/abuses of which the user is a target | |
6359 | abusesAcceptedCount: | |
6360 | type: integer | |
6361 | description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team | |
6362 | abusesCreatedCount: | |
6363 | type: integer | |
6364 | description: Count of reports/abuses created by the user | |
6365 | videoCommentsCount: | |
6366 | type: integer | |
6367 | description: Count of comments published | |
3e9e6f2f RK |
6368 | AddUser: |
6369 | properties: | |
6370 | username: | |
b8375da9 | 6371 | $ref: '#/components/schemas/username' |
3e9e6f2f | 6372 | password: |
b8375da9 | 6373 | $ref: '#/components/schemas/password' |
3e9e6f2f RK |
6374 | email: |
6375 | type: string | |
84f6e32c RK |
6376 | format: email |
6377 | description: The user email | |
3e9e6f2f | 6378 | videoQuota: |
84f6e32c | 6379 | type: integer |
b8375da9 RK |
6380 | description: The user video quota in bytes |
6381 | example: -1 | |
fbe1bc2a | 6382 | videoQuotaDaily: |
84f6e32c | 6383 | type: integer |
b8375da9 RK |
6384 | description: The user daily video quota in bytes |
6385 | example: -1 | |
6d989edc | 6386 | channelName: |
b8375da9 | 6387 | $ref: '#/components/schemas/usernameChannel' |
3e9e6f2f | 6388 | role: |
0590bb46 | 6389 | $ref: '#/components/schemas/UserRole' |
6d989edc C |
6390 | adminFlags: |
6391 | $ref: '#/components/schemas/UserAdminFlags' | |
3e9e6f2f RK |
6392 | required: |
6393 | - username | |
6394 | - password | |
6395 | ||
6396 | - videoQuota | |
fbe1bc2a | 6397 | - videoQuotaDaily |
3e9e6f2f RK |
6398 | - role |
6399 | UpdateUser: | |
6400 | properties: | |
3e9e6f2f | 6401 | email: |
84f6e32c | 6402 | description: The updated email of the user |
77b0c6b5 RK |
6403 | allOf: |
6404 | - $ref: '#/components/schemas/User/properties/email' | |
6d989edc C |
6405 | emailVerified: |
6406 | type: boolean | |
6407 | description: Set the email as verified | |
3e9e6f2f | 6408 | videoQuota: |
84f6e32c | 6409 | type: integer |
b8375da9 | 6410 | description: The updated video quota of the user in bytes |
fbe1bc2a | 6411 | videoQuotaDaily: |
84f6e32c | 6412 | type: integer |
b8375da9 | 6413 | description: The updated daily video quota of the user in bytes |
6d989edc C |
6414 | pluginAuth: |
6415 | type: string | |
6416 | nullable: true | |
6417 | description: The auth plugin to use to authenticate the user | |
6418 | example: 'peertube-plugin-auth-saml2' | |
3e9e6f2f | 6419 | role: |
0590bb46 | 6420 | $ref: '#/components/schemas/UserRole' |
6d989edc C |
6421 | adminFlags: |
6422 | $ref: '#/components/schemas/UserAdminFlags' | |
3e9e6f2f | 6423 | UpdateMe: |
77b0c6b5 | 6424 | # see shared/models/users/user-update-me.model.ts: |
3e9e6f2f RK |
6425 | properties: |
6426 | password: | |
b8375da9 | 6427 | $ref: '#/components/schemas/password' |
77b0c6b5 RK |
6428 | currentPassword: |
6429 | $ref: '#/components/schemas/password' | |
3e9e6f2f | 6430 | email: |
77b0c6b5 RK |
6431 | description: new email used for login and service communications |
6432 | allOf: | |
6433 | - $ref: '#/components/schemas/User/properties/email' | |
6434 | displayName: | |
3e9e6f2f | 6435 | type: string |
77b0c6b5 RK |
6436 | description: new name of the user in its representations |
6437 | minLength: 3 | |
6438 | maxLength: 120 | |
3e9e6f2f RK |
6439 | displayNSFW: |
6440 | type: string | |
77b0c6b5 | 6441 | description: new NSFW display policy |
84f6e32c RK |
6442 | enum: |
6443 | - 'true' | |
6444 | - 'false' | |
6445 | - both | |
77b0c6b5 RK |
6446 | webTorrentEnabled: |
6447 | type: boolean | |
6448 | description: whether to enable P2P in the player or not | |
3e9e6f2f | 6449 | autoPlayVideo: |
84f6e32c | 6450 | type: boolean |
77b0c6b5 RK |
6451 | description: new preference regarding playing videos automatically |
6452 | autoPlayNextVideo: | |
6453 | type: boolean | |
6454 | description: new preference regarding playing following videos automatically | |
6455 | autoPlayNextVideoPlaylist: | |
6456 | type: boolean | |
6457 | description: new preference regarding playing following playlist videos automatically | |
6458 | videosHistoryEnabled: | |
6459 | type: boolean | |
6460 | description: whether to keep track of watched history or not | |
6461 | videoLanguages: | |
6462 | type: array | |
6463 | items: | |
6464 | type: string | |
6465 | description: list of languages to filter videos down to | |
6466 | theme: | |
6467 | type: string | |
6468 | noInstanceConfigWarningModal: | |
6469 | type: boolean | |
6470 | noWelcomeModal: | |
6471 | type: boolean | |
3e9e6f2f RK |
6472 | GetMeVideoRating: |
6473 | properties: | |
6474 | id: | |
b8375da9 | 6475 | $ref: '#/components/schemas/id' |
3e9e6f2f | 6476 | rating: |
30b40713 RK |
6477 | type: string |
6478 | enum: | |
6479 | - like | |
6480 | - dislike | |
6481 | - none | |
84f6e32c | 6482 | description: Rating of the video |
3e9e6f2f RK |
6483 | required: |
6484 | - id | |
6485 | - rating | |
c100a614 YB |
6486 | VideoRating: |
6487 | properties: | |
6488 | video: | |
6489 | $ref: '#/components/schemas/Video' | |
6490 | rating: | |
30b40713 RK |
6491 | type: string |
6492 | enum: | |
6493 | - like | |
6494 | - dislike | |
6495 | - none | |
6496 | description: Rating of the video | |
c100a614 YB |
6497 | required: |
6498 | - video | |
6499 | - rating | |
3e9e6f2f RK |
6500 | RegisterUser: |
6501 | properties: | |
6502 | username: | |
77b0c6b5 RK |
6503 | description: immutable name of the user, used to find or mention its actor |
6504 | allOf: | |
6505 | - $ref: '#/components/schemas/username' | |
3e9e6f2f | 6506 | password: |
b8375da9 | 6507 | $ref: '#/components/schemas/password' |
3e9e6f2f RK |
6508 | email: |
6509 | type: string | |
84f6e32c | 6510 | format: email |
77b0c6b5 | 6511 | description: email of the user, used for login or service communications |
1f20622f C |
6512 | displayName: |
6513 | type: string | |
77b0c6b5 | 6514 | description: editable name of the user, displayed in its representations |
84f6e32c RK |
6515 | minLength: 1 |
6516 | maxLength: 120 | |
1f20622f C |
6517 | channel: |
6518 | type: object | |
77b0c6b5 | 6519 | description: channel base information used to create the first channel of the user |
1f20622f C |
6520 | properties: |
6521 | name: | |
b8375da9 | 6522 | $ref: '#/components/schemas/usernameChannel' |
1f20622f | 6523 | displayName: |
77b0c6b5 | 6524 | $ref: '#/components/schemas/VideoChannel/properties/displayName' |
3e9e6f2f RK |
6525 | required: |
6526 | - username | |
6527 | - password | |
6528 | ||
4302058c | 6529 | |
e2464d22 RK |
6530 | OAuthClient: |
6531 | properties: | |
6532 | client_id: | |
6533 | type: string | |
6534 | pattern: /^[a-z0-9]$/ | |
6535 | maxLength: 32 | |
6536 | minLength: 32 | |
6537 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | |
6538 | client_secret: | |
6539 | type: string | |
6540 | pattern: /^[a-zA-Z0-9]$/ | |
6541 | maxLength: 32 | |
6542 | minLength: 32 | |
6543 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | |
6544 | OAuthToken-password: | |
6545 | allOf: | |
6546 | - $ref: '#/components/schemas/OAuthClient' | |
6547 | - type: object | |
6548 | properties: | |
6549 | grant_type: | |
6550 | type: string | |
6551 | enum: | |
6552 | - password | |
6553 | - refresh_token | |
6554 | default: password | |
6555 | username: | |
6556 | $ref: '#/components/schemas/User/properties/username' | |
6557 | password: | |
6558 | $ref: '#/components/schemas/password' | |
6559 | required: | |
6560 | - client_id | |
6561 | - client_secret | |
6562 | - grant_type | |
6563 | - username | |
6564 | - password | |
6565 | OAuthToken-refresh_token: | |
6566 | allOf: | |
6567 | - $ref: '#/components/schemas/OAuthClient' | |
6568 | - type: object | |
6569 | properties: | |
6570 | grant_type: | |
6571 | type: string | |
6572 | enum: | |
6573 | - password | |
6574 | - refresh_token | |
6575 | default: password | |
6576 | refresh_token: | |
6577 | type: string | |
6578 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | |
6579 | required: | |
6580 | - client_id | |
6581 | - client_secret | |
6582 | - grant_type | |
6583 | - refresh_token | |
6584 | ||
b8375da9 | 6585 | VideoChannel: |
3e9e6f2f | 6586 | properties: |
b8375da9 | 6587 | # GET/POST/PUT properties |
7d14d4d2 C |
6588 | displayName: |
6589 | type: string | |
77b0c6b5 | 6590 | description: editable name of the channel, displayed in its representations |
b8375da9 | 6591 | example: Videos of Framasoft |
4302058c RK |
6592 | minLength: 1 |
6593 | maxLength: 120 | |
3e9e6f2f RK |
6594 | description: |
6595 | type: string | |
b8375da9 | 6596 | example: Videos made with <3 by Framasoft |
4302058c RK |
6597 | minLength: 3 |
6598 | maxLength: 1000 | |
7d14d4d2 C |
6599 | support: |
6600 | type: string | |
b8375da9 | 6601 | description: text shown by default on all videos of this channel, to tell the audience how to support it |
9a320a06 | 6602 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4302058c RK |
6603 | minLength: 3 |
6604 | maxLength: 1000 | |
b8375da9 RK |
6605 | # GET-only properties |
6606 | id: | |
6607 | readOnly: true | |
6608 | allOf: | |
6609 | - $ref: '#/components/schemas/id' | |
6610 | isLocal: | |
6611 | readOnly: true | |
6612 | type: boolean | |
6613 | updatedAt: | |
6614 | readOnly: true | |
6615 | type: string | |
6616 | format: date-time | |
6617 | ownerAccount: | |
6618 | readOnly: true | |
6619 | nullable: true | |
6620 | type: object | |
6621 | properties: | |
6622 | id: | |
6623 | type: integer | |
6624 | uuid: | |
6625 | $ref: '#/components/schemas/UUIDv4' | |
4302058c RK |
6626 | VideoChannelCreate: |
6627 | allOf: | |
b8375da9 | 6628 | - $ref: '#/components/schemas/VideoChannel' |
4302058c RK |
6629 | - properties: |
6630 | name: | |
b8375da9 RK |
6631 | description: username of the channel to create |
6632 | allOf: | |
6633 | - $ref: '#/components/schemas/usernameChannel' | |
7d14d4d2 C |
6634 | required: |
6635 | - name | |
6636 | - displayName | |
6637 | VideoChannelUpdate: | |
4302058c | 6638 | allOf: |
b8375da9 | 6639 | - $ref: '#/components/schemas/VideoChannel' |
4302058c RK |
6640 | - properties: |
6641 | bulkVideosSupportUpdate: | |
6642 | type: boolean | |
b8375da9 | 6643 | description: Update the support field for all videos of this channel |
045bcd0d RK |
6644 | VideoChannelList: |
6645 | properties: | |
6646 | total: | |
6647 | type: integer | |
6648 | example: 1 | |
6649 | data: | |
6650 | type: array | |
6651 | items: | |
6652 | allOf: | |
6653 | - $ref: '#/components/schemas/VideoChannel' | |
6654 | - $ref: '#/components/schemas/Actor' | |
1569a818 | 6655 | |
06746a8b RK |
6656 | MRSSPeerLink: |
6657 | type: object | |
6658 | xml: | |
6659 | name: 'media:peerLink' | |
6660 | properties: | |
6661 | href: | |
6662 | type: string | |
6663 | xml: | |
6664 | attribute: true | |
6665 | type: | |
6666 | type: string | |
6667 | enum: | |
6668 | - application/x-bittorrent | |
6669 | xml: | |
6670 | attribute: true | |
6671 | MRSSGroupContent: | |
6672 | type: object | |
6673 | xml: | |
6674 | name: 'media:content' | |
6675 | properties: | |
6676 | url: | |
6677 | type: string | |
84f6e32c | 6678 | format: url |
06746a8b RK |
6679 | xml: |
6680 | attribute: true | |
6681 | fileSize: | |
6682 | type: integer | |
6683 | xml: | |
6684 | attribute: true | |
6685 | type: | |
6686 | type: string | |
6687 | xml: | |
6688 | attribute: true | |
6689 | framerate: | |
6690 | type: integer | |
6691 | xml: | |
6692 | attribute: true | |
6693 | duration: | |
6694 | type: integer | |
6695 | xml: | |
6696 | attribute: true | |
6697 | height: | |
6698 | type: integer | |
6699 | xml: | |
6700 | attribute: true | |
6701 | lang: | |
6702 | type: string | |
6703 | xml: | |
6704 | attribute: true | |
6705 | VideoCommentsForXML: | |
6706 | type: array | |
6707 | xml: | |
6708 | wrapped: true | |
6709 | name: 'channel' | |
6710 | items: | |
6711 | type: object | |
6712 | xml: | |
6713 | name: 'item' | |
6714 | properties: | |
6715 | link: | |
6716 | type: string | |
84f6e32c | 6717 | format: url |
06746a8b RK |
6718 | guid: |
6719 | type: string | |
6720 | pubDate: | |
6721 | type: string | |
6722 | format: date-time | |
6723 | 'content:encoded': | |
6724 | type: string | |
6725 | 'dc:creator': | |
6726 | type: string | |
6727 | VideosForXML: | |
6728 | type: array | |
6729 | xml: | |
6730 | wrapped: true | |
6731 | name: 'channel' | |
6732 | items: | |
6733 | type: object | |
6734 | xml: | |
6735 | name: 'item' | |
6736 | properties: | |
6737 | link: | |
6738 | type: string | |
84f6e32c | 6739 | format: url |
06746a8b RK |
6740 | description: video watch page URL |
6741 | guid: | |
6742 | type: string | |
6743 | description: video canonical URL | |
6744 | pubDate: | |
6745 | type: string | |
6746 | format: date-time | |
6747 | description: video publication date | |
6748 | description: | |
6749 | type: string | |
6750 | description: video description | |
6751 | 'content:encoded': | |
6752 | type: string | |
6753 | description: video description | |
6754 | 'dc:creator': | |
6755 | type: string | |
6756 | description: publisher user name | |
6757 | 'media:category': | |
6758 | type: integer | |
6759 | description: video category (MRSS) | |
6760 | 'media:community': | |
6761 | type: object | |
6762 | description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS) | |
6763 | properties: | |
6764 | 'media:statistics': | |
6765 | type: object | |
6766 | properties: | |
6767 | views: | |
6768 | type: integer | |
6769 | xml: | |
6770 | attribute: true | |
6771 | 'media:embed': | |
6772 | type: object | |
6773 | properties: | |
6774 | url: | |
6775 | type: string | |
84f6e32c | 6776 | format: url |
06746a8b RK |
6777 | description: video embed path, relative to the canonical URL domain (MRSS) |
6778 | xml: | |
6779 | attribute: true | |
6780 | 'media:player': | |
6781 | type: object | |
6782 | properties: | |
6783 | url: | |
6784 | type: string | |
84f6e32c | 6785 | format: url |
06746a8b RK |
6786 | description: video watch path, relative to the canonical URL domain (MRSS) |
6787 | xml: | |
6788 | attribute: true | |
6789 | 'media:thumbnail': | |
6790 | type: object | |
6791 | properties: | |
6792 | url: | |
6793 | type: string | |
84f6e32c | 6794 | format: url |
06746a8b RK |
6795 | xml: |
6796 | attribute: true | |
6797 | height: | |
6798 | type: integer | |
6799 | xml: | |
6800 | attribute: true | |
6801 | width: | |
6802 | type: integer | |
6803 | xml: | |
6804 | attribute: true | |
6805 | 'media:title': | |
6806 | type: string | |
6807 | description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles. | |
6808 | 'media:description': | |
6809 | type: string | |
6810 | 'media:rating': | |
6811 | type: string | |
6812 | enum: | |
6813 | - nonadult | |
6814 | - adult | |
6815 | description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS) | |
6816 | 'enclosure': | |
6817 | type: object | |
6818 | description: main streamable file for the video | |
6819 | properties: | |
6820 | url: | |
6821 | type: string | |
84f6e32c | 6822 | format: url |
06746a8b RK |
6823 | xml: |
6824 | attribute: true | |
6825 | type: | |
6826 | type: string | |
6827 | enum: | |
6828 | - application/x-bittorrent | |
6829 | xml: | |
6830 | attribute: true | |
6831 | length: | |
6832 | type: integer | |
6833 | xml: | |
6834 | attribute: true | |
6835 | 'media:group': | |
6836 | type: array | |
6837 | 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) | |
6838 | items: | |
6839 | anyOf: | |
6840 | - $ref: '#/components/schemas/MRSSPeerLink' | |
f4d59981 RK |
6841 | - $ref: '#/components/schemas/MRSSGroupContent' |
6842 | NotificationSettingValue: | |
6843 | type: integer | |
6844 | description: > | |
6845 | Notification type | |
84f6e32c | 6846 | |
f4d59981 | 6847 | - `0` NONE |
84f6e32c | 6848 | |
f4d59981 | 6849 | - `1` WEB |
84f6e32c | 6850 | |
f4d59981 RK |
6851 | - `2` EMAIL |
6852 | enum: | |
6853 | - 0 | |
6854 | - 1 | |
6855 | - 3 | |
6856 | Notification: | |
6857 | properties: | |
6858 | id: | |
b8375da9 | 6859 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6860 | type: |
6861 | type: integer | |
6862 | description: > | |
6863 | Notification type, following the `UserNotificationType` enum: | |
84f6e32c | 6864 | |
f4d59981 | 6865 | - `1` NEW_VIDEO_FROM_SUBSCRIPTION |
84f6e32c | 6866 | |
f4d59981 | 6867 | - `2` NEW_COMMENT_ON_MY_VIDEO |
84f6e32c | 6868 | |
310b5219 | 6869 | - `3` NEW_ABUSE_FOR_MODERATORS |
84f6e32c | 6870 | |
f4d59981 | 6871 | - `4` BLACKLIST_ON_MY_VIDEO |
84f6e32c | 6872 | |
f4d59981 | 6873 | - `5` UNBLACKLIST_ON_MY_VIDEO |
84f6e32c | 6874 | |
f4d59981 | 6875 | - `6` MY_VIDEO_PUBLISHED |
84f6e32c | 6876 | |
f4d59981 | 6877 | - `7` MY_VIDEO_IMPORT_SUCCESS |
84f6e32c | 6878 | |
f4d59981 | 6879 | - `8` MY_VIDEO_IMPORT_ERROR |
84f6e32c | 6880 | |
f4d59981 | 6881 | - `9` NEW_USER_REGISTRATION |
84f6e32c | 6882 | |
f4d59981 | 6883 | - `10` NEW_FOLLOW |
84f6e32c | 6884 | |
f4d59981 | 6885 | - `11` COMMENT_MENTION |
84f6e32c | 6886 | |
f4d59981 | 6887 | - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS |
84f6e32c | 6888 | |
f4d59981 | 6889 | - `13` NEW_INSTANCE_FOLLOWER |
84f6e32c | 6890 | |
f4d59981 RK |
6891 | - `14` AUTO_INSTANCE_FOLLOWING |
6892 | read: | |
6893 | type: boolean | |
6894 | video: | |
6895 | nullable: true | |
6896 | allOf: | |
6897 | - $ref: '#/components/schemas/VideoInfo' | |
6898 | - type: object | |
6899 | properties: | |
6900 | channel: | |
6901 | $ref: '#/components/schemas/ActorInfo' | |
6902 | videoImport: | |
6903 | nullable: true | |
6904 | type: object | |
6905 | properties: | |
6906 | id: | |
b8375da9 | 6907 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6908 | video: |
6909 | nullable: true | |
6910 | $ref: '#/components/schemas/VideoInfo' | |
6911 | torrentName: | |
6912 | type: string | |
6913 | nullable: true | |
6914 | magnetUri: | |
2c4876f2 | 6915 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' |
f4d59981 RK |
6916 | targetUri: |
6917 | type: string | |
84f6e32c | 6918 | format: uri |
f4d59981 RK |
6919 | nullable: true |
6920 | comment: | |
6921 | nullable: true | |
6922 | type: object | |
6923 | properties: | |
6924 | id: | |
b8375da9 | 6925 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6926 | threadId: |
6927 | type: integer | |
6928 | video: | |
6929 | $ref: '#/components/schemas/VideoInfo' | |
6930 | account: | |
6931 | $ref: '#/components/schemas/ActorInfo' | |
6932 | videoAbuse: | |
6933 | nullable: true | |
6934 | type: object | |
6935 | properties: | |
6936 | id: | |
b8375da9 | 6937 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6938 | video: |
6939 | allOf: | |
6940 | - $ref: '#/components/schemas/VideoInfo' | |
6941 | videoBlacklist: | |
6942 | nullable: true | |
6943 | type: object | |
6944 | properties: | |
6945 | id: | |
b8375da9 | 6946 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6947 | video: |
6948 | allOf: | |
6949 | - $ref: '#/components/schemas/VideoInfo' | |
6950 | account: | |
6951 | nullable: true | |
6952 | allOf: | |
6953 | - $ref: '#/components/schemas/ActorInfo' | |
6954 | actorFollow: | |
6955 | type: object | |
6956 | nullable: true | |
6957 | properties: | |
6958 | id: | |
b8375da9 | 6959 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6960 | follower: |
6961 | $ref: '#/components/schemas/ActorInfo' | |
6962 | state: | |
6963 | type: string | |
6964 | enum: | |
6965 | - pending | |
6966 | - accepted | |
6967 | following: | |
6968 | type: object | |
6969 | properties: | |
6970 | type: | |
6971 | type: string | |
6972 | enum: | |
6973 | - account | |
6974 | - channel | |
6975 | - instance | |
6976 | name: | |
6977 | type: string | |
6978 | displayName: | |
6979 | type: string | |
6980 | host: | |
6981 | type: string | |
84f6e32c | 6982 | format: hostname |
f4d59981 RK |
6983 | createdAt: |
6984 | type: string | |
6985 | format: date-time | |
6986 | updatedAt: | |
6987 | type: string | |
6988 | format: date-time | |
6989 | NotificationListResponse: | |
6990 | properties: | |
6991 | total: | |
6992 | type: integer | |
84f6e32c | 6993 | example: 1 |
f4d59981 RK |
6994 | data: |
6995 | type: array | |
84f6e32c | 6996 | maxItems: 100 |
f4d59981 | 6997 | items: |
7461d440 RK |
6998 | $ref: '#/components/schemas/Notification' |
6999 | Plugin: | |
7000 | properties: | |
7001 | name: | |
7002 | type: string | |
84f6e32c | 7003 | example: peertube-plugin-auth-ldap |
7461d440 RK |
7004 | type: |
7005 | type: integer | |
84f6e32c RK |
7006 | description: > |
7007 | - `1`: PLUGIN | |
7008 | ||
7009 | - `2`: THEME | |
7461d440 RK |
7010 | enum: |
7011 | - 1 | |
7012 | - 2 | |
7013 | latestVersion: | |
7014 | type: string | |
84f6e32c | 7015 | example: 0.0.3 |
7461d440 RK |
7016 | version: |
7017 | type: string | |
84f6e32c | 7018 | example: 0.0.1 |
7461d440 RK |
7019 | enabled: |
7020 | type: boolean | |
7021 | uninstalled: | |
7022 | type: boolean | |
7023 | peertubeEngine: | |
7024 | type: string | |
84f6e32c | 7025 | example: 2.2.0 |
7461d440 RK |
7026 | description: |
7027 | type: string | |
7028 | homepage: | |
7029 | type: string | |
84f6e32c RK |
7030 | format: url |
7031 | example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap | |
7461d440 RK |
7032 | settings: |
7033 | type: object | |
7034 | additionalProperties: true | |
7035 | createdAt: | |
7036 | type: string | |
7037 | format: date-time | |
7038 | updatedAt: | |
7039 | type: string | |
7040 | format: date-time | |
7041 | PluginResponse: | |
7042 | properties: | |
7043 | total: | |
7044 | type: integer | |
84f6e32c | 7045 | example: 1 |
7461d440 RK |
7046 | data: |
7047 | type: array | |
84f6e32c | 7048 | maxItems: 100 |
7461d440 | 7049 | items: |
2c318664 | 7050 | $ref: '#/components/schemas/Plugin' |
4e239e35 C |
7051 | |
7052 | LiveVideoUpdate: | |
7053 | properties: | |
7054 | saveReplay: | |
7055 | type: boolean | |
bb4ba6d9 C |
7056 | permanentLive: |
7057 | description: User can stream multiple times in a permanent live | |
7058 | type: boolean | |
4e239e35 C |
7059 | |
7060 | LiveVideoResponse: | |
7061 | properties: | |
7062 | rtmpUrl: | |
7063 | type: string | |
7064 | streamKey: | |
7065 | type: string | |
7066 | description: RTMP stream key to use to stream into this live video | |
7067 | saveReplay: | |
7068 | type: boolean | |
bb4ba6d9 C |
7069 | permanentLive: |
7070 | description: User can stream multiple times in a permanent live | |
7071 | type: boolean | |
4e239e35 | 7072 | |
75cba40d C |
7073 | |
7074 | ||
2c318664 RK |
7075 | callbacks: |
7076 | searchIndex: | |
c00f96ce | 7077 | 'https://search.example.org/api/v1/search/videos': |
2c318664 RK |
7078 | post: |
7079 | summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget` | |
7080 | responses: | |
7081 | '200': | |
7082 | description: successful operation | |
7083 | content: | |
7084 | application/json: | |
7085 | schema: | |
1e904cde | 7086 | $ref: '#/components/schemas/VideoListResponse' |