]>
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 | |
37a44fc9 C |
3586 | |
3587 | /search/video-playlists: | |
3588 | get: | |
3589 | tags: | |
3590 | - Search | |
3591 | summary: Search playlists | |
3592 | operationId: searchPlaylists | |
3593 | parameters: | |
3594 | - name: search | |
3595 | in: query | |
3596 | required: true | |
3597 | description: > | |
3598 | String to search. If the user can make a remote URI search, and the string is an URI then the | |
3599 | PeerTube instance will fetch the remote object and add it to its database. Then, | |
3600 | you can use the REST API to fetch the complete playlist information and interact with it. | |
3601 | schema: | |
3602 | type: string | |
3603 | - $ref: '#/components/parameters/start' | |
3604 | - $ref: '#/components/parameters/count' | |
3605 | - $ref: '#/components/parameters/searchTarget' | |
3606 | - $ref: '#/components/parameters/sort' | |
3607 | callbacks: | |
3608 | 'searchTarget === search-index': | |
3609 | $ref: '#/components/callbacks/searchIndex' | |
3610 | responses: | |
3611 | '200': | |
3612 | description: successful operation | |
3613 | content: | |
3614 | application/json: | |
3615 | schema: | |
3616 | type: object | |
3617 | properties: | |
3618 | total: | |
3619 | type: integer | |
3620 | example: 1 | |
3621 | data: | |
3622 | type: array | |
3623 | items: | |
3624 | $ref: '#/components/schemas/VideoPlaylist' | |
3625 | '500': | |
3626 | description: search index unavailable | |
da35b419 RK |
3627 | |
3628 | /server/blocklist/accounts: | |
06746a8b RK |
3629 | get: |
3630 | tags: | |
3631 | - Account Blocks | |
3632 | summary: List account blocks | |
3633 | security: | |
3634 | - OAuth2: | |
3635 | - admin | |
3636 | parameters: | |
3637 | - $ref: '#/components/parameters/start' | |
3638 | - $ref: '#/components/parameters/count' | |
3639 | - $ref: '#/components/parameters/sort' | |
3640 | responses: | |
3641 | '200': | |
3642 | description: successful operation | |
3643 | post: | |
3644 | tags: | |
3645 | - Account Blocks | |
3646 | summary: Block an account | |
3647 | security: | |
3648 | - OAuth2: | |
3649 | - admin | |
3650 | requestBody: | |
3651 | content: | |
3652 | application/json: | |
3653 | schema: | |
3654 | type: object | |
3655 | properties: | |
3656 | accountName: | |
3657 | type: string | |
84f6e32c | 3658 | example: chocobozzz@example.org |
06746a8b RK |
3659 | description: account to block, in the form `username@domain` |
3660 | required: | |
3661 | - accountName | |
3662 | responses: | |
3663 | '200': | |
3664 | description: successful operation | |
3665 | '409': | |
3666 | description: self-blocking forbidden | |
3f71c4c0 | 3667 | |
da35b419 | 3668 | '/server/blocklist/accounts/{accountName}': |
06746a8b RK |
3669 | delete: |
3670 | tags: | |
3671 | - Account Blocks | |
3672 | summary: Unblock an account by its handle | |
3673 | security: | |
3674 | - OAuth2: | |
3675 | - admin | |
3676 | parameters: | |
3677 | - name: accountName | |
3678 | in: path | |
3679 | required: true | |
3680 | description: account to unblock, in the form `username@domain` | |
3681 | schema: | |
3682 | type: string | |
3683 | responses: | |
3684 | '201': | |
3685 | description: successful operation | |
3686 | '404': | |
3687 | description: account or account block does not exist | |
da35b419 RK |
3688 | |
3689 | /server/blocklist/servers: | |
06746a8b RK |
3690 | get: |
3691 | tags: | |
3692 | - Server Blocks | |
3693 | summary: List server blocks | |
3694 | security: | |
3695 | - OAuth2: | |
3696 | - admin | |
3697 | parameters: | |
3698 | - $ref: '#/components/parameters/start' | |
3699 | - $ref: '#/components/parameters/count' | |
3700 | - $ref: '#/components/parameters/sort' | |
3701 | responses: | |
3702 | '200': | |
3703 | description: successful operation | |
3704 | post: | |
3705 | tags: | |
3706 | - Server Blocks | |
3707 | summary: Block a server | |
3708 | security: | |
3709 | - OAuth2: | |
3710 | - admin | |
3711 | requestBody: | |
3712 | content: | |
3713 | application/json: | |
3714 | schema: | |
3715 | type: object | |
3716 | properties: | |
84f6e32c | 3717 | host: |
06746a8b | 3718 | type: string |
84f6e32c | 3719 | format: hostname |
06746a8b RK |
3720 | description: server domain to block |
3721 | required: | |
84f6e32c | 3722 | - host |
06746a8b | 3723 | responses: |
ca98c8f8 | 3724 | '204': |
06746a8b RK |
3725 | description: successful operation |
3726 | '409': | |
3727 | description: self-blocking forbidden | |
3f71c4c0 | 3728 | |
da35b419 | 3729 | '/server/blocklist/servers/{host}': |
06746a8b RK |
3730 | delete: |
3731 | tags: | |
3732 | - Server Blocks | |
3733 | summary: Unblock a server by its domain | |
3734 | security: | |
3735 | - OAuth2: | |
3736 | - admin | |
3737 | parameters: | |
3738 | - name: host | |
3739 | in: path | |
3740 | required: true | |
3741 | description: server domain to unblock | |
3742 | schema: | |
3743 | type: string | |
84f6e32c | 3744 | format: hostname |
06746a8b | 3745 | responses: |
ca98c8f8 | 3746 | '204': |
06746a8b RK |
3747 | description: successful operation |
3748 | '404': | |
3749 | description: account block does not exist | |
da35b419 | 3750 | |
a4ce4223 | 3751 | /server/redundancy/{host}: |
04b703f6 RK |
3752 | put: |
3753 | tags: | |
3754 | - Instance Redundancy | |
3755 | summary: Update a server redundancy policy | |
3756 | security: | |
3757 | - OAuth2: | |
3758 | - admin | |
3759 | parameters: | |
3760 | - name: host | |
3761 | in: path | |
3762 | required: true | |
3763 | description: server domain to mirror | |
3764 | schema: | |
3765 | type: string | |
84f6e32c | 3766 | format: hostname |
04b703f6 RK |
3767 | requestBody: |
3768 | content: | |
3769 | application/json: | |
3770 | schema: | |
3771 | type: object | |
3772 | properties: | |
3773 | redundancyAllowed: | |
3774 | type: boolean | |
3775 | description: allow mirroring of the host's local videos | |
3776 | required: | |
3777 | - redundancyAllowed | |
3778 | responses: | |
3779 | '204': | |
3780 | description: successful operation | |
3781 | '404': | |
3782 | description: server is not already known | |
3f71c4c0 | 3783 | |
a4ce4223 | 3784 | /server/redundancy/videos: |
04b703f6 RK |
3785 | get: |
3786 | tags: | |
3787 | - Video Mirroring | |
3788 | summary: List videos being mirrored | |
e2adb8cb | 3789 | operationId: getMirroredVideos |
04b703f6 RK |
3790 | security: |
3791 | - OAuth2: | |
3792 | - admin | |
3793 | parameters: | |
3794 | - name: target | |
3795 | in: query | |
3796 | required: true | |
3797 | description: direction of the mirror | |
3798 | schema: | |
3799 | type: string | |
3800 | enum: | |
3801 | - my-videos | |
3802 | - remote-videos | |
3803 | - $ref: '#/components/parameters/start' | |
3804 | - $ref: '#/components/parameters/count' | |
3805 | - $ref: '#/components/parameters/videoRedundanciesSort' | |
3806 | responses: | |
3807 | '200': | |
3808 | description: successful operation | |
3809 | content: | |
3810 | application/json: | |
3811 | schema: | |
3812 | type: array | |
3813 | items: | |
3814 | $ref: '#/components/schemas/VideoRedundancy' | |
3815 | post: | |
3816 | tags: | |
3817 | - Video Mirroring | |
3818 | summary: Mirror a video | |
e2adb8cb | 3819 | operationId: putMirroredVideo |
04b703f6 RK |
3820 | security: |
3821 | - OAuth2: | |
3822 | - admin | |
3823 | requestBody: | |
3824 | content: | |
3825 | application/json: | |
3826 | schema: | |
3827 | type: object | |
3828 | properties: | |
3829 | videoId: | |
b8375da9 | 3830 | $ref: '#/components/schemas/Video/properties/id' |
04b703f6 RK |
3831 | required: |
3832 | - videoId | |
3833 | responses: | |
3834 | '204': | |
3835 | description: successful operation | |
3836 | '400': | |
3837 | description: cannot mirror a local video | |
3838 | '404': | |
3839 | description: video does not exist | |
3840 | '409': | |
3841 | description: video is already mirrored | |
3f71c4c0 | 3842 | |
a4ce4223 | 3843 | /server/redundancy/videos/{redundancyId}: |
04b703f6 RK |
3844 | delete: |
3845 | tags: | |
3846 | - Video Mirroring | |
3847 | summary: Delete a mirror done on a video | |
e2adb8cb | 3848 | operationId: delMirroredVideo |
04b703f6 RK |
3849 | security: |
3850 | - OAuth2: | |
3851 | - admin | |
3852 | parameters: | |
3853 | - name: redundancyId | |
3854 | in: path | |
3855 | required: true | |
3856 | description: id of an existing redundancy on a video | |
3857 | schema: | |
3858 | type: string | |
3859 | responses: | |
3860 | '204': | |
3861 | description: successful operation | |
3862 | '404': | |
3863 | description: video redundancy not found | |
da35b419 | 3864 | |
06746a8b RK |
3865 | '/feeds/video-comments.{format}': |
3866 | get: | |
3867 | tags: | |
3868 | - Feeds | |
3869 | summary: List comments on videos | |
e2adb8cb | 3870 | operationId: getSyndicatedComments |
06746a8b RK |
3871 | parameters: |
3872 | - name: format | |
3873 | in: path | |
3874 | required: true | |
00494d6e | 3875 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' |
06746a8b RK |
3876 | schema: |
3877 | type: string | |
3878 | enum: | |
3879 | - xml | |
3880 | - rss | |
3881 | - rss2 | |
3882 | - atom | |
3883 | - atom1 | |
3884 | - json | |
3885 | - json1 | |
3886 | - name: videoId | |
d73810be | 3887 | in: query |
06746a8b RK |
3888 | description: 'limit listing to a specific video' |
3889 | schema: | |
3890 | type: string | |
00494d6e RK |
3891 | - name: accountId |
3892 | in: query | |
3893 | description: 'limit listing to a specific account' | |
3894 | schema: | |
3895 | type: string | |
3896 | - name: accountName | |
3897 | in: query | |
3898 | description: 'limit listing to a specific account' | |
3899 | schema: | |
3900 | type: string | |
3901 | - name: videoChannelId | |
3902 | in: query | |
3903 | description: 'limit listing to a specific video channel' | |
3904 | schema: | |
3905 | type: string | |
3906 | - name: videoChannelName | |
3907 | in: query | |
3908 | description: 'limit listing to a specific video channel' | |
3909 | schema: | |
3910 | type: string | |
06746a8b RK |
3911 | responses: |
3912 | '204': | |
3913 | description: successful operation | |
3914 | headers: | |
3915 | Cache-Control: | |
3916 | schema: | |
3917 | type: string | |
3918 | default: 'max-age=900' # 15 min cache | |
3919 | content: | |
3920 | application/xml: | |
3921 | schema: | |
3922 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3923 | examples: |
3924 | nightly: | |
3925 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
06746a8b RK |
3926 | application/rss+xml: |
3927 | schema: | |
3928 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3929 | examples: |
3930 | nightly: | |
3931 | externalValue: https://peertube2.cpy.re/feeds/video-comments.rss?filter=local | |
06746a8b RK |
3932 | text/xml: |
3933 | schema: | |
3934 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3935 | examples: |
3936 | nightly: | |
3937 | externalValue: https://peertube2.cpy.re/feeds/video-comments.xml?filter=local | |
06746a8b RK |
3938 | application/atom+xml: |
3939 | schema: | |
3940 | $ref: '#/components/schemas/VideoCommentsForXML' | |
64df4b65 RK |
3941 | examples: |
3942 | nightly: | |
3943 | externalValue: https://peertube2.cpy.re/feeds/video-comments.atom?filter=local | |
06746a8b RK |
3944 | application/json: |
3945 | schema: | |
3946 | type: object | |
64df4b65 RK |
3947 | examples: |
3948 | nightly: | |
3949 | externalValue: https://peertube2.cpy.re/feeds/video-comments.json?filter=local | |
00494d6e RK |
3950 | '400': |
3951 | x-summary: field inconsistencies | |
3952 | description: > | |
3953 | Arises when: | |
3954 | - videoId filter is mixed with a channel filter | |
3955 | '404': | |
3956 | description: video, video channel or account not found | |
06746a8b RK |
3957 | '406': |
3958 | description: accept header unsupported | |
3f71c4c0 | 3959 | |
06746a8b RK |
3960 | '/feeds/videos.{format}': |
3961 | get: | |
3962 | tags: | |
3963 | - Feeds | |
3964 | summary: List videos | |
e2adb8cb | 3965 | operationId: getSyndicatedVideos |
06746a8b RK |
3966 | parameters: |
3967 | - name: format | |
3968 | in: path | |
3969 | required: true | |
00494d6e | 3970 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' |
06746a8b RK |
3971 | schema: |
3972 | type: string | |
3973 | enum: | |
3974 | - xml | |
3975 | - rss | |
3976 | - rss2 | |
3977 | - atom | |
3978 | - atom1 | |
3979 | - json | |
3980 | - json1 | |
3981 | - name: accountId | |
d73810be | 3982 | in: query |
06746a8b RK |
3983 | description: 'limit listing to a specific account' |
3984 | schema: | |
3985 | type: string | |
3986 | - name: accountName | |
d73810be | 3987 | in: query |
06746a8b RK |
3988 | description: 'limit listing to a specific account' |
3989 | schema: | |
3990 | type: string | |
3991 | - name: videoChannelId | |
d73810be | 3992 | in: query |
06746a8b RK |
3993 | description: 'limit listing to a specific video channel' |
3994 | schema: | |
3995 | type: string | |
3996 | - name: videoChannelName | |
d73810be | 3997 | in: query |
06746a8b RK |
3998 | description: 'limit listing to a specific video channel' |
3999 | schema: | |
4000 | type: string | |
84f6e32c RK |
4001 | - $ref: '#/components/parameters/sort' |
4002 | - $ref: '#/components/parameters/nsfw' | |
4003 | - $ref: '#/components/parameters/filter' | |
06746a8b RK |
4004 | responses: |
4005 | '204': | |
4006 | description: successful operation | |
4007 | headers: | |
4008 | Cache-Control: | |
4009 | schema: | |
4010 | type: string | |
4011 | default: 'max-age=900' # 15 min cache | |
4012 | content: | |
4013 | application/xml: | |
4014 | schema: | |
4015 | $ref: '#/components/schemas/VideosForXML' | |
84f6e32c RK |
4016 | examples: |
4017 | nightly: | |
4018 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
06746a8b RK |
4019 | application/rss+xml: |
4020 | schema: | |
4021 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
4022 | examples: |
4023 | nightly: | |
4024 | externalValue: https://peertube2.cpy.re/feeds/videos.rss?filter=local | |
06746a8b RK |
4025 | text/xml: |
4026 | schema: | |
4027 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
4028 | examples: |
4029 | nightly: | |
4030 | externalValue: https://peertube2.cpy.re/feeds/videos.xml?filter=local | |
06746a8b RK |
4031 | application/atom+xml: |
4032 | schema: | |
4033 | $ref: '#/components/schemas/VideosForXML' | |
64df4b65 RK |
4034 | examples: |
4035 | nightly: | |
4036 | externalValue: https://peertube2.cpy.re/feeds/videos.atom?filter=local | |
06746a8b RK |
4037 | application/json: |
4038 | schema: | |
4039 | type: object | |
64df4b65 RK |
4040 | examples: |
4041 | nightly: | |
4042 | externalValue: https://peertube2.cpy.re/feeds/videos.json?filter=local | |
00494d6e RK |
4043 | '404': |
4044 | description: video channel or account not found | |
06746a8b RK |
4045 | '406': |
4046 | description: accept header unsupported | |
3f71c4c0 | 4047 | |
64df4b65 RK |
4048 | '/feeds/subscriptions.{format}': |
4049 | get: | |
4050 | tags: | |
4051 | - Feeds | |
4052 | - Account | |
4053 | summary: List videos of subscriptions tied to a token | |
e2adb8cb | 4054 | operationId: getSyndicatedSubscriptionVideos |
64df4b65 RK |
4055 | parameters: |
4056 | - name: format | |
4057 | in: path | |
4058 | required: true | |
4059 | description: 'format expected (we focus on making `rss` the most featureful ; it serves [Media RSS](https://www.rssboard.org/media-rss))' | |
4060 | schema: | |
4061 | type: string | |
4062 | enum: | |
4063 | - xml | |
4064 | - rss | |
4065 | - rss2 | |
4066 | - atom | |
4067 | - atom1 | |
4068 | - json | |
4069 | - json1 | |
4070 | - name: accountId | |
4071 | in: query | |
4072 | description: limit listing to a specific account | |
4073 | schema: | |
4074 | type: string | |
4075 | required: true | |
4076 | - name: token | |
4077 | in: query | |
4078 | description: private token allowing access | |
4079 | schema: | |
4080 | type: string | |
4081 | required: true | |
4082 | - $ref: '#/components/parameters/sort' | |
4083 | - $ref: '#/components/parameters/nsfw' | |
4084 | - $ref: '#/components/parameters/filter' | |
4085 | responses: | |
4086 | '204': | |
4087 | description: successful operation | |
4088 | headers: | |
4089 | Cache-Control: | |
4090 | schema: | |
4091 | type: string | |
4092 | default: 'max-age=900' # 15 min cache | |
4093 | content: | |
4094 | application/xml: | |
4095 | schema: | |
4096 | $ref: '#/components/schemas/VideosForXML' | |
4097 | application/rss+xml: | |
4098 | schema: | |
4099 | $ref: '#/components/schemas/VideosForXML' | |
4100 | text/xml: | |
4101 | schema: | |
4102 | $ref: '#/components/schemas/VideosForXML' | |
4103 | application/atom+xml: | |
4104 | schema: | |
4105 | $ref: '#/components/schemas/VideosForXML' | |
4106 | application/json: | |
4107 | schema: | |
4108 | type: object | |
4109 | '406': | |
4110 | description: accept header unsupported | |
3f71c4c0 | 4111 | |
7461d440 RK |
4112 | /plugins: |
4113 | get: | |
4114 | tags: | |
4115 | - Plugins | |
4116 | summary: List plugins | |
e2adb8cb | 4117 | operationId: getPlugins |
7461d440 RK |
4118 | security: |
4119 | - OAuth2: | |
4120 | - admin | |
4121 | parameters: | |
4122 | - name: pluginType | |
4123 | in: query | |
4124 | schema: | |
4125 | type: integer | |
4126 | - name: uninstalled | |
4127 | in: query | |
4128 | schema: | |
4129 | type: boolean | |
4130 | - $ref: '#/components/parameters/start' | |
4131 | - $ref: '#/components/parameters/count' | |
4132 | - $ref: '#/components/parameters/sort' | |
4133 | responses: | |
4134 | '200': | |
4135 | description: successful operation | |
4136 | content: | |
4137 | application/json: | |
4138 | schema: | |
4139 | $ref: '#/components/schemas/PluginResponse' | |
3f71c4c0 | 4140 | |
7461d440 RK |
4141 | /plugins/available: |
4142 | get: | |
4143 | tags: | |
4144 | - Plugins | |
4145 | summary: List available plugins | |
e2adb8cb | 4146 | operationId: getAvailablePlugins |
7461d440 RK |
4147 | security: |
4148 | - OAuth2: | |
4149 | - admin | |
4150 | parameters: | |
4151 | - name: search | |
4152 | in: query | |
4153 | schema: | |
4154 | type: string | |
4155 | - name: pluginType | |
4156 | in: query | |
4157 | schema: | |
4158 | type: integer | |
4159 | - name: currentPeerTubeEngine | |
4160 | in: query | |
4161 | schema: | |
4162 | type: string | |
4163 | - $ref: '#/components/parameters/start' | |
4164 | - $ref: '#/components/parameters/count' | |
4165 | - $ref: '#/components/parameters/sort' | |
4166 | responses: | |
4167 | '200': | |
4168 | description: successful operation | |
4169 | content: | |
4170 | application/json: | |
4171 | schema: | |
4172 | $ref: '#/components/schemas/PluginResponse' | |
4173 | '503': | |
4174 | description: plugin index unavailable | |
3f71c4c0 | 4175 | |
7461d440 RK |
4176 | /plugins/install: |
4177 | post: | |
4178 | tags: | |
4179 | - Plugins | |
4180 | summary: Install a plugin | |
e2adb8cb | 4181 | operationId: addPlugin |
7461d440 RK |
4182 | security: |
4183 | - OAuth2: | |
4184 | - admin | |
4185 | requestBody: | |
4186 | content: | |
4187 | application/json: | |
4188 | schema: | |
4189 | oneOf: | |
4190 | - type: object | |
4191 | properties: | |
4192 | npmName: | |
4193 | type: string | |
84f6e32c | 4194 | example: peertube-plugin-auth-ldap |
7461d440 RK |
4195 | required: |
4196 | - npmName | |
4197 | additionalProperties: false | |
4198 | - type: object | |
4199 | properties: | |
4200 | path: | |
4201 | type: string | |
4202 | required: | |
4203 | - path | |
4204 | additionalProperties: false | |
4205 | responses: | |
4206 | '204': | |
4207 | description: successful operation | |
4208 | '400': | |
4209 | description: should have either `npmName` or `path` set | |
3f71c4c0 | 4210 | |
7461d440 RK |
4211 | /plugins/update: |
4212 | post: | |
4213 | tags: | |
4214 | - Plugins | |
4215 | summary: Update a plugin | |
e2adb8cb | 4216 | operationId: updatePlugin |
7461d440 RK |
4217 | security: |
4218 | - OAuth2: | |
4219 | - admin | |
4220 | requestBody: | |
4221 | content: | |
4222 | application/json: | |
4223 | schema: | |
4224 | oneOf: | |
4225 | - type: object | |
4226 | properties: | |
4227 | npmName: | |
4228 | type: string | |
84f6e32c | 4229 | example: peertube-plugin-auth-ldap |
7461d440 RK |
4230 | required: |
4231 | - npmName | |
4232 | additionalProperties: false | |
4233 | - type: object | |
4234 | properties: | |
4235 | path: | |
4236 | type: string | |
4237 | required: | |
4238 | - path | |
4239 | additionalProperties: false | |
4240 | responses: | |
4241 | '204': | |
4242 | description: successful operation | |
4243 | '400': | |
4244 | description: should have either `npmName` or `path` set | |
4245 | '404': | |
4246 | description: existing plugin not found | |
3f71c4c0 | 4247 | |
7461d440 RK |
4248 | /plugins/uninstall: |
4249 | post: | |
4250 | tags: | |
4251 | - Plugins | |
4252 | summary: Uninstall a plugin | |
e2adb8cb | 4253 | operationId: uninstallPlugin |
7461d440 RK |
4254 | security: |
4255 | - OAuth2: | |
4256 | - admin | |
4257 | requestBody: | |
4258 | content: | |
4259 | application/json: | |
4260 | schema: | |
4261 | type: object | |
4262 | properties: | |
4263 | npmName: | |
4264 | type: string | |
84f6e32c RK |
4265 | description: name of the plugin/theme in its package.json |
4266 | example: peertube-plugin-auth-ldap | |
7461d440 RK |
4267 | required: |
4268 | - npmName | |
4269 | responses: | |
4270 | '204': | |
4271 | description: successful operation | |
4272 | '404': | |
4273 | description: existing plugin not found | |
3f71c4c0 | 4274 | |
7461d440 RK |
4275 | /plugins/{npmName}: |
4276 | get: | |
4277 | tags: | |
4278 | - Plugins | |
4279 | summary: Get a plugin | |
e2adb8cb | 4280 | operationId: getPlugin |
7461d440 RK |
4281 | security: |
4282 | - OAuth2: | |
4283 | - admin | |
4284 | parameters: | |
84f6e32c | 4285 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4286 | responses: |
4287 | '200': | |
4288 | description: successful operation | |
4289 | content: | |
4290 | application/json: | |
4291 | schema: | |
4292 | $ref: '#/components/schemas/Plugin' | |
4293 | '404': | |
4294 | description: plugin not found | |
3f71c4c0 | 4295 | |
7461d440 RK |
4296 | /plugins/{npmName}/settings: |
4297 | put: | |
4298 | tags: | |
4299 | - Plugins | |
4300 | summary: Set a plugin's settings | |
4301 | security: | |
4302 | - OAuth2: | |
4303 | - admin | |
4304 | parameters: | |
84f6e32c | 4305 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4306 | requestBody: |
4307 | content: | |
4308 | application/json: | |
4309 | schema: | |
4310 | type: object | |
4311 | properties: | |
4312 | settings: | |
4313 | type: object | |
4314 | additionalProperties: true | |
4315 | responses: | |
4316 | '204': | |
4317 | description: successful operation | |
4318 | '404': | |
4319 | description: plugin not found | |
3f71c4c0 | 4320 | |
7461d440 RK |
4321 | /plugins/{npmName}/public-settings: |
4322 | get: | |
4323 | tags: | |
4324 | - Plugins | |
4325 | summary: Get a plugin's public settings | |
7461d440 | 4326 | parameters: |
84f6e32c | 4327 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4328 | responses: |
4329 | '200': | |
4330 | description: successful operation | |
4331 | content: | |
4332 | application/json: | |
4333 | schema: | |
4334 | type: object | |
4335 | additionalProperties: true | |
4336 | '404': | |
4337 | description: plugin not found | |
3f71c4c0 | 4338 | |
7461d440 RK |
4339 | /plugins/{npmName}/registered-settings: |
4340 | get: | |
4341 | tags: | |
4342 | - Plugins | |
4343 | summary: Get a plugin's registered settings | |
4344 | security: | |
4345 | - OAuth2: | |
4346 | - admin | |
4347 | parameters: | |
84f6e32c | 4348 | - $ref: '#/components/parameters/npmName' |
7461d440 RK |
4349 | responses: |
4350 | '200': | |
4351 | description: successful operation | |
4352 | content: | |
4353 | application/json: | |
4354 | schema: | |
4355 | type: object | |
4356 | additionalProperties: true | |
4357 | '404': | |
4358 | description: plugin not found | |
3f71c4c0 | 4359 | |
3e9e6f2f | 4360 | servers: |
8f9e8be1 | 4361 | - url: 'https://peertube2.cpy.re/api/v1' |
f4d59981 | 4362 | description: Live Test Server (live data - latest nightly version) |
6441981b | 4363 | - url: 'https://peertube3.cpy.re/api/v1' |
b029d58a | 4364 | description: Live Test Server (live data - latest RC version) |
f4d59981 RK |
4365 | - url: 'https://peertube.cpy.re/api/v1' |
4366 | description: Live Test Server (live data - stable version) | |
3e9e6f2f RK |
4367 | components: |
4368 | parameters: | |
4369 | start: | |
4370 | name: start | |
4371 | in: query | |
4372 | required: false | |
06746a8b | 4373 | description: Offset used to paginate results |
3e9e6f2f | 4374 | schema: |
06746a8b | 4375 | type: integer |
84f6e32c | 4376 | minimum: 0 |
3e9e6f2f RK |
4377 | count: |
4378 | name: count | |
4379 | in: query | |
4380 | required: false | |
06746a8b | 4381 | description: "Number of items to return" |
3e9e6f2f | 4382 | schema: |
06746a8b | 4383 | type: integer |
84f6e32c | 4384 | default: 15 |
06746a8b RK |
4385 | maximum: 100 |
4386 | minimum: 1 | |
3e9e6f2f RK |
4387 | sort: |
4388 | name: sort | |
4389 | in: query | |
4390 | required: false | |
84f6e32c | 4391 | description: Sort column |
3e9e6f2f RK |
4392 | schema: |
4393 | type: string | |
84f6e32c | 4394 | example: -createdAt |
8491293b RK |
4395 | search: |
4396 | name: search | |
4397 | in: query | |
4398 | required: false | |
4399 | description: Plain text search, applied to various parts of the model depending on endpoint | |
4400 | schema: | |
4401 | type: string | |
ad031145 C |
4402 | searchTarget: |
4403 | name: searchTarget | |
4404 | in: query | |
4405 | required: false | |
4406 | description: > | |
4407 | If the administrator enabled search index support, you can override the default search target. | |
4408 | ||
4409 | ||
4410 | **Warning**: If you choose to make an index search, PeerTube will get results from a third party service. | |
84f6e32c | 4411 | It means the instance may not yet know the objects you fetched. If you want to load video/channel information: |
ad031145 C |
4412 | * If the current user has the ability to make a remote URI search (this information is available in the config endpoint), |
4413 | then reuse the search API to make a search using the object URI so PeerTube instance fetches the remote object and fill its database. | |
4414 | After that, you can use the classic REST API endpoints to fetch the complete object or interact with it | |
84f6e32c | 4415 | * 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 |
4416 | the data from the origin instance API |
4417 | schema: | |
4418 | type: string | |
4419 | enum: | |
4420 | - 'local' | |
4421 | - 'search-index' | |
fd5af7a2 RK |
4422 | videosSort: |
4423 | name: sort | |
4424 | in: query | |
4425 | required: false | |
4426 | description: Sort videos by criteria | |
4427 | schema: | |
4428 | type: string | |
4429 | enum: | |
04b703f6 | 4430 | - name |
fd5af7a2 RK |
4431 | - -duration |
4432 | - -createdAt | |
4433 | - -publishedAt | |
4434 | - -views | |
4435 | - -likes | |
4436 | - -trending | |
923d3d5a | 4437 | - -hot |
fd5af7a2 RK |
4438 | videosSearchSort: |
4439 | name: sort | |
4440 | in: query | |
4441 | required: false | |
4442 | description: Sort videos by criteria | |
4443 | schema: | |
4444 | type: string | |
4445 | enum: | |
04b703f6 | 4446 | - name |
fd5af7a2 RK |
4447 | - -duration |
4448 | - -createdAt | |
4449 | - -publishedAt | |
4450 | - -views | |
4451 | - -likes | |
4452 | - -match | |
71810d0b RK |
4453 | commentsSort: |
4454 | name: sort | |
4455 | in: query | |
4456 | required: false | |
4457 | description: Sort comments by criteria | |
4458 | schema: | |
4459 | type: string | |
4460 | enum: | |
4461 | - -createdAt | |
4462 | - -totalReplies | |
fd5af7a2 RK |
4463 | blacklistsSort: |
4464 | name: sort | |
4465 | in: query | |
4466 | required: false | |
c756bae0 | 4467 | description: Sort blocklists by criteria |
fd5af7a2 RK |
4468 | schema: |
4469 | type: string | |
4470 | enum: | |
4471 | - -id | |
04b703f6 | 4472 | - name |
fd5af7a2 RK |
4473 | - -duration |
4474 | - -views | |
4475 | - -likes | |
4476 | - -dislikes | |
4477 | - -uuid | |
4478 | - -createdAt | |
8491293b RK |
4479 | usersSearch: |
4480 | name: search | |
4481 | in: query | |
4482 | required: false | |
4483 | description: Plain text search that will match with user usernames or emails | |
4484 | schema: | |
4485 | type: string | |
4486 | usersBlocked: | |
4487 | name: blocked | |
4488 | in: query | |
4489 | required: false | |
4490 | description: Filter results down to (un)banned users | |
4491 | schema: | |
4492 | type: boolean | |
fd5af7a2 RK |
4493 | usersSort: |
4494 | name: sort | |
4495 | in: query | |
4496 | required: false | |
4497 | description: Sort users by criteria | |
4498 | schema: | |
4499 | type: string | |
4500 | enum: | |
4501 | - -id | |
4502 | - -username | |
4503 | - -createdAt | |
4504 | abusesSort: | |
4505 | name: sort | |
4506 | in: query | |
4507 | required: false | |
4508 | description: Sort abuses by criteria | |
4509 | schema: | |
4510 | type: string | |
4511 | enum: | |
4512 | - -id | |
4513 | - -createdAt | |
4514 | - -state | |
04b703f6 RK |
4515 | videoRedundanciesSort: |
4516 | name: sort | |
4517 | in: query | |
4518 | required: false | |
4519 | description: Sort abuses by criteria | |
4520 | schema: | |
4521 | type: string | |
4522 | enum: | |
4523 | - name | |
3e9e6f2f RK |
4524 | name: |
4525 | name: name | |
4526 | in: path | |
4527 | required: true | |
f2eb23cd | 4528 | description: The username or handle of the account |
3e9e6f2f RK |
4529 | schema: |
4530 | type: string | |
84f6e32c | 4531 | example: chocobozzz | chocobozzz@example.org |
3e9e6f2f RK |
4532 | id: |
4533 | name: id | |
4534 | in: path | |
4535 | required: true | |
4536 | description: The user id | |
4537 | schema: | |
b8375da9 | 4538 | $ref: '#/components/schemas/id' |
cb9d028a | 4539 | idOrUUID: |
3e9e6f2f RK |
4540 | name: id |
4541 | in: path | |
4542 | required: true | |
c1843150 | 4543 | description: The object id or uuid |
3e9e6f2f | 4544 | schema: |
84f6e32c | 4545 | oneOf: |
b8375da9 | 4546 | - $ref: '#/components/schemas/id' |
f880a5e7 | 4547 | - $ref: '#/components/schemas/UUIDv4' |
c00100b6 RK |
4548 | playlistId: |
4549 | name: playlistId | |
4550 | in: path | |
4551 | required: true | |
4552 | description: Playlist id | |
4553 | schema: | |
4554 | $ref: '#/components/schemas/VideoPlaylist/properties/id' | |
c1843150 C |
4555 | playlistElementId: |
4556 | name: playlistElementId | |
4557 | in: path | |
4558 | required: true | |
4559 | description: Playlist element id | |
4560 | schema: | |
b8375da9 | 4561 | $ref: '#/components/schemas/id' |
50e16ccf C |
4562 | abuseId: |
4563 | name: abuseId | |
4564 | in: path | |
4565 | required: true | |
310b5219 | 4566 | description: Abuse id |
50e16ccf | 4567 | schema: |
b8375da9 | 4568 | $ref: '#/components/schemas/Abuse/properties/id' |
668b7f09 C |
4569 | abuseMessageId: |
4570 | name: abuseMessageId | |
4571 | in: path | |
4572 | required: true | |
4573 | description: Abuse message id | |
4574 | schema: | |
b8375da9 | 4575 | $ref: '#/components/schemas/AbuseMessage/properties/id' |
67ae04a5 C |
4576 | captionLanguage: |
4577 | name: captionLanguage | |
4578 | in: path | |
4579 | required: true | |
4580 | description: The caption language | |
4581 | schema: | |
b8375da9 | 4582 | $ref: '#/components/schemas/VideoLanguageSet' |
9ce3d302 C |
4583 | channelHandle: |
4584 | name: channelHandle | |
3e9e6f2f RK |
4585 | in: path |
4586 | required: true | |
84f6e32c | 4587 | description: The video channel handle |
3e9e6f2f RK |
4588 | schema: |
4589 | type: string | |
84f6e32c | 4590 | example: my_username | my_username@example.com |
cb9d028a C |
4591 | subscriptionHandle: |
4592 | name: subscriptionHandle | |
4593 | in: path | |
4594 | required: true | |
84f6e32c | 4595 | description: The subscription handle |
cb9d028a C |
4596 | schema: |
4597 | type: string | |
84f6e32c | 4598 | example: my_username | my_username@example.com |
cb9d028a | 4599 | threadId: |
3e9e6f2f RK |
4600 | name: threadId |
4601 | in: path | |
4602 | required: true | |
cb9d028a C |
4603 | description: The thread id (root comment id) |
4604 | schema: | |
85a60d8b | 4605 | type: integer |
cb9d028a C |
4606 | commentId: |
4607 | name: commentId | |
4608 | in: path | |
4609 | required: true | |
3e9e6f2f RK |
4610 | description: The comment id |
4611 | schema: | |
b8375da9 | 4612 | $ref: '#/components/schemas/VideoComment/properties/id' |
1fd61899 C |
4613 | isLive: |
4614 | name: isLive | |
4615 | in: query | |
4616 | required: false | |
4617 | description: whether or not the video is a live | |
4618 | schema: | |
4619 | type: boolean | |
fd5af7a2 RK |
4620 | categoryOneOf: |
4621 | name: categoryOneOf | |
4622 | in: query | |
4623 | required: false | |
40cfb36b | 4624 | description: category id of the video (see [/videos/categories](#operation/getCategories)) |
fd5af7a2 RK |
4625 | schema: |
4626 | oneOf: | |
b8375da9 | 4627 | - $ref: '#/components/schemas/VideoCategorySet' |
fd5af7a2 RK |
4628 | - type: array |
4629 | items: | |
b8375da9 | 4630 | $ref: '#/components/schemas/VideoCategorySet' |
2beb9895 RK |
4631 | style: form |
4632 | explode: false | |
fd5af7a2 RK |
4633 | tagsOneOf: |
4634 | name: tagsOneOf | |
4635 | in: query | |
4636 | required: false | |
4637 | description: tag(s) of the video | |
4638 | schema: | |
4639 | oneOf: | |
4640 | - type: string | |
4641 | - type: array | |
f6d6e7f8 | 4642 | maxItems: 5 |
fd5af7a2 RK |
4643 | items: |
4644 | type: string | |
2beb9895 RK |
4645 | style: form |
4646 | explode: false | |
fd5af7a2 RK |
4647 | tagsAllOf: |
4648 | name: tagsAllOf | |
4649 | in: query | |
4650 | required: false | |
4651 | description: tag(s) of the video, where all should be present in the video | |
4652 | schema: | |
4653 | oneOf: | |
4654 | - type: string | |
4655 | - type: array | |
4656 | items: | |
4657 | type: string | |
2beb9895 RK |
4658 | style: form |
4659 | explode: false | |
fd5af7a2 RK |
4660 | languageOneOf: |
4661 | name: languageOneOf | |
4662 | in: query | |
4663 | required: false | |
40cfb36b | 4664 | 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 |
4665 | schema: |
4666 | oneOf: | |
b8375da9 | 4667 | - $ref: '#/components/schemas/VideoLanguageSet' |
fd5af7a2 RK |
4668 | - type: array |
4669 | items: | |
b8375da9 | 4670 | $ref: '#/components/schemas/VideoLanguageSet' |
2beb9895 RK |
4671 | style: form |
4672 | explode: false | |
fd5af7a2 RK |
4673 | licenceOneOf: |
4674 | name: licenceOneOf | |
4675 | in: query | |
4676 | required: false | |
40cfb36b | 4677 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) |
fd5af7a2 RK |
4678 | schema: |
4679 | oneOf: | |
b8375da9 | 4680 | - $ref: '#/components/schemas/VideoLicenceSet' |
fd5af7a2 RK |
4681 | - type: array |
4682 | items: | |
b8375da9 | 4683 | $ref: '#/components/schemas/VideoLicenceSet' |
2beb9895 RK |
4684 | style: form |
4685 | explode: false | |
59c794a5 C |
4686 | skipCount: |
4687 | name: skipCount | |
4688 | in: query | |
4689 | required: false | |
4690 | description: if you don't need the `total` in the response | |
4691 | schema: | |
4692 | type: string | |
4693 | enum: | |
4694 | - 'true' | |
4695 | - 'false' | |
06746a8b | 4696 | default: 'false' |
fd5af7a2 RK |
4697 | nsfw: |
4698 | name: nsfw | |
4699 | in: query | |
4700 | required: false | |
4701 | description: whether to include nsfw videos, if any | |
4702 | schema: | |
4703 | type: string | |
4704 | enum: | |
4705 | - 'true' | |
4706 | - 'false' | |
4707 | filter: | |
4708 | name: filter | |
4709 | in: query | |
4710 | required: false | |
4711 | description: > | |
0aa52e17 | 4712 | Special filters which might require special rights: |
fd5af7a2 RK |
4713 | * `local` - only videos local to the instance |
4714 | * `all-local` - only videos local to the instance, but showing private and unlisted videos (requires Admin privileges) | |
0aa52e17 | 4715 | * `all` - all videos, showing private and unlisted videos (requires Admin privileges) |
fd5af7a2 RK |
4716 | schema: |
4717 | type: string | |
4718 | enum: | |
4719 | - local | |
4720 | - all-local | |
e76d5784 RK |
4721 | subscriptionsUris: |
4722 | name: uris | |
4723 | in: query | |
4724 | required: true | |
4725 | description: list of uris to check if each is part of the user subscriptions | |
4726 | schema: | |
4727 | type: array | |
4728 | items: | |
4729 | type: string | |
84f6e32c RK |
4730 | format: uri |
4731 | npmName: | |
4732 | name: npmName | |
4733 | in: path | |
4734 | required: true | |
4735 | description: name of the plugin/theme on npmjs.com or in its package.json | |
4736 | schema: | |
4737 | type: string | |
4738 | example: peertube-plugin-auth-ldap | |
040d6896 RK |
4739 | jobType: |
4740 | name: jobType | |
4741 | in: query | |
4742 | required: false | |
4743 | description: job type | |
4744 | schema: | |
4745 | type: string | |
4746 | enum: | |
4747 | - activitypub-follow | |
4748 | - activitypub-http-broadcast | |
4749 | - activitypub-http-fetcher | |
4750 | - activitypub-http-unicast | |
4751 | ||
4752 | - video-transcoding | |
4753 | - video-file-import | |
4754 | - video-import | |
4755 | - videos-views | |
4756 | - activitypub-refresher | |
4757 | - video-redundancy | |
4758 | - video-live-ending | |
06dc7a1b RK |
4759 | followState: |
4760 | name: state | |
4761 | in: query | |
4762 | schema: | |
4763 | type: string | |
4764 | enum: | |
4765 | - pending | |
4766 | - accepted | |
4767 | actorType: | |
4768 | name: actorType | |
4769 | in: query | |
4770 | schema: | |
4771 | type: string | |
4772 | enum: | |
4773 | - Person | |
4774 | - Application | |
4775 | - Group | |
4776 | - Service | |
4777 | - Organization | |
3e9e6f2f RK |
4778 | securitySchemes: |
4779 | OAuth2: | |
3c5e02f3 | 4780 | description: | |
3e9e6f2f | 4781 | Authenticating via OAuth requires the following steps: |
3c5e02f3 | 4782 | - Have an activated account |
e2464d22 RK |
4783 | - [Generate] an access token for that account at `/api/v1/users/token`. |
4784 | - Make requests with the *Authorization: Bearer <token\>* header | |
3c5e02f3 | 4785 | - Profit, depending on the role assigned to the account |
3e9e6f2f | 4786 | |
e2464d22 | 4787 | Note that the __access token is valid for 1 day__ and is given |
3c5e02f3 | 4788 | along with a __refresh token valid for 2 weeks__. |
e2464d22 RK |
4789 | |
4790 | [Generate]: https://docs.joinpeertube.org/api-rest-getting-started | |
3e9e6f2f RK |
4791 | type: oauth2 |
4792 | flows: | |
4793 | password: | |
e2464d22 | 4794 | tokenUrl: /api/v1/users/token |
3e9e6f2f RK |
4795 | scopes: |
4796 | admin: Admin scope | |
4797 | moderator: Moderator scope | |
4798 | user: User scope | |
4799 | schemas: | |
b8375da9 RK |
4800 | # Resuable core properties |
4801 | id: | |
4802 | type: integer | |
4803 | minimum: 1 | |
4804 | example: 42 | |
f880a5e7 RK |
4805 | UUIDv4: |
4806 | type: string | |
4807 | format: uuid | |
4808 | example: 9c9de5e8-0a1e-484a-b099-e80766180a6d | |
4809 | pattern: '^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$' | |
f880a5e7 RK |
4810 | minLength: 36 |
4811 | maxLength: 36 | |
b8375da9 RK |
4812 | username: |
4813 | type: string | |
77b0c6b5 | 4814 | description: immutable name of the user, used to find or mention its actor |
b8375da9 | 4815 | example: chocobozzz |
e2464d22 | 4816 | pattern: '/^[a-z0-9._]+$/' |
b8375da9 RK |
4817 | minLength: 1 |
4818 | maxLength: 50 | |
4819 | usernameChannel: | |
4820 | type: string | |
77b0c6b5 | 4821 | description: immutable name of the channel, used to interact with its actor |
9a320a06 | 4822 | example: framasoft_videos |
e2464d22 RK |
4823 | pattern: '/^[a-zA-Z0-9\\-_.:]+$/' |
4824 | minLength: 1 | |
4825 | maxLength: 50 | |
b8375da9 RK |
4826 | password: |
4827 | type: string | |
4828 | format: password | |
b8375da9 RK |
4829 | minLength: 6 |
4830 | maxLength: 255 | |
f880a5e7 | 4831 | |
40cfb36b RK |
4832 | VideoCategorySet: |
4833 | type: integer | |
4834 | description: category id of the video (see [/videos/categories](#operation/getCategories)) | |
b8375da9 | 4835 | example: 15 |
dfcb6f50 | 4836 | VideoConstantNumber-Category: |
3e9e6f2f RK |
4837 | properties: |
4838 | id: | |
40cfb36b | 4839 | $ref: '#/components/schemas/VideoCategorySet' |
3e9e6f2f RK |
4840 | label: |
4841 | type: string | |
b8375da9 | 4842 | example: Science & Technology |
40cfb36b RK |
4843 | |
4844 | VideoLicenceSet: | |
4845 | type: integer | |
4846 | description: licence id of the video (see [/videos/licences](#operation/getLicences)) | |
b8375da9 | 4847 | example: 2 |
dfcb6f50 RK |
4848 | VideoConstantNumber-Licence: |
4849 | properties: | |
4850 | id: | |
40cfb36b | 4851 | $ref: '#/components/schemas/VideoLicenceSet' |
dfcb6f50 RK |
4852 | label: |
4853 | type: string | |
b8375da9 RK |
4854 | example: Attribution - Share Alike |
4855 | ||
40cfb36b RK |
4856 | VideoLanguageSet: |
4857 | type: string | |
4858 | description: language id of the video (see [/videos/languages](#operation/getLanguages)) | |
b8375da9 | 4859 | example: en |
dfcb6f50 | 4860 | VideoConstantString-Language: |
3e9e6f2f RK |
4861 | properties: |
4862 | id: | |
40cfb36b | 4863 | $ref: '#/components/schemas/VideoLanguageSet' |
3e9e6f2f RK |
4864 | label: |
4865 | type: string | |
b8375da9 | 4866 | example: English |
c1843150 C |
4867 | |
4868 | VideoPlaylistPrivacySet: | |
4869 | type: integer | |
4870 | enum: | |
4871 | - 1 | |
4872 | - 2 | |
4873 | - 3 | |
40cfb36b | 4874 | description: Video playlist privacy policy (see [/video-playlists/privacies]) |
c1843150 C |
4875 | VideoPlaylistPrivacyConstant: |
4876 | properties: | |
4877 | id: | |
4878 | $ref: '#/components/schemas/VideoPlaylistPrivacySet' | |
4879 | label: | |
4880 | type: string | |
4881 | ||
4882 | VideoPlaylistTypeSet: | |
4883 | type: integer | |
4884 | enum: | |
4885 | - 1 | |
4886 | - 2 | |
40cfb36b | 4887 | description: The video playlist type (Regular = `1`, Watch Later = `2`) |
c1843150 C |
4888 | VideoPlaylistTypeConstant: |
4889 | properties: | |
4890 | id: | |
4891 | $ref: '#/components/schemas/VideoPlaylistTypeSet' | |
4892 | label: | |
4893 | type: string | |
4894 | ||
ee89e8fd C |
4895 | VideoPrivacySet: |
4896 | type: integer | |
3e9e6f2f | 4897 | enum: |
ee89e8fd C |
4898 | - 1 |
4899 | - 2 | |
4900 | - 3 | |
c1843150 | 4901 | - 4 |
40cfb36b | 4902 | description: privacy id of the video (see [/videos/privacies](#operation/getPrivacyPolicies)) |
ee89e8fd C |
4903 | VideoPrivacyConstant: |
4904 | properties: | |
4905 | id: | |
c1843150 | 4906 | $ref: '#/components/schemas/VideoPrivacySet' |
ee89e8fd C |
4907 | label: |
4908 | type: string | |
50e16ccf | 4909 | |
0590bb46 C |
4910 | NSFWPolicy: |
4911 | type: string | |
4912 | enum: | |
4913 | - display | |
4914 | - blur | |
4915 | - do_not_list | |
4916 | ||
4917 | UserRole: | |
06746a8b | 4918 | type: integer |
0590bb46 C |
4919 | enum: |
4920 | - 0 | |
4921 | - 1 | |
4922 | - 2 | |
06746a8b | 4923 | description: 'The user role (Admin = `0`, Moderator = `1`, User = `2`)' |
2c318664 | 4924 | example: 2 |
6d989edc C |
4925 | UserAdminFlags: |
4926 | type: integer | |
4927 | enum: | |
4928 | - 0 | |
4929 | - 1 | |
c756bae0 | 4930 | description: 'Admin flags for the user (None = `0`, Bypass video blocklist = `1`)' |
6d989edc | 4931 | example: 1 |
0590bb46 | 4932 | |
5dce26d2 C |
4933 | VideoStateConstant: |
4934 | properties: | |
4935 | id: | |
4936 | type: integer | |
4937 | enum: | |
4938 | - 1 | |
4939 | - 2 | |
4940 | - 3 | |
06746a8b | 4941 | description: 'The video state (Published = `1`, to transcode = `2`, to import = `3`)' |
5dce26d2 C |
4942 | label: |
4943 | type: string | |
50e16ccf | 4944 | |
4f32032f | 4945 | AbuseStateSet: |
50e16ccf C |
4946 | type: integer |
4947 | enum: | |
4948 | - 1 | |
4949 | - 2 | |
4950 | - 3 | |
668b7f09 | 4951 | description: 'The abuse state (Pending = `1`, Rejected = `2`, Accepted = `3`)' |
4f32032f | 4952 | AbuseStateConstant: |
50e16ccf C |
4953 | properties: |
4954 | id: | |
4f32032f | 4955 | $ref: '#/components/schemas/AbuseStateSet' |
50e16ccf C |
4956 | label: |
4957 | type: string | |
4f32032f | 4958 | AbusePredefinedReasons: |
1ebddadd RK |
4959 | type: array |
4960 | items: | |
4961 | type: string | |
4962 | enum: | |
4963 | - violentOrAbusive | |
4964 | - hatefulOrAbusive | |
4965 | - spamOrMisleading | |
4966 | - privacy | |
4967 | - rights | |
4968 | - serverRules | |
4969 | - thumbnails | |
4970 | - captions | |
84f6e32c | 4971 | example: [spamOrMisleading] |
50e16ccf | 4972 | |
40cfb36b RK |
4973 | VideoResolutionSet: |
4974 | type: integer | |
4975 | description: | | |
4976 | Video resolution (`0`, `240`, `360`, `720`, `1080`, `1440` or `2160`) | |
4977 | ||
4978 | `0` is used as a special value for stillimage videos dedicated to audio, a.k.a. audio-only videos. | |
4979 | example: 240 | |
5dce26d2 | 4980 | VideoResolutionConstant: |
2c4876f2 | 4981 | description: resolutions and their labels for the video |
5dce26d2 C |
4982 | properties: |
4983 | id: | |
40cfb36b | 4984 | $ref: '#/components/schemas/VideoResolutionSet' |
5dce26d2 C |
4985 | label: |
4986 | type: string | |
84f6e32c | 4987 | example: 240p |
5dce26d2 C |
4988 | VideoScheduledUpdate: |
4989 | properties: | |
4990 | privacy: | |
4991 | $ref: '#/components/schemas/VideoPrivacySet' | |
5dce26d2 C |
4992 | updateAt: |
4993 | type: string | |
4994 | format: date | |
4995 | description: When to update the video | |
4996 | required: | |
4997 | - updateAt | |
c1843150 | 4998 | AccountSummary: |
5dce26d2 C |
4999 | properties: |
5000 | id: | |
06746a8b | 5001 | type: integer |
5dce26d2 C |
5002 | name: |
5003 | type: string | |
5004 | displayName: | |
5005 | type: string | |
5006 | url: | |
5007 | type: string | |
84f6e32c | 5008 | format: url |
5dce26d2 C |
5009 | host: |
5010 | type: string | |
84f6e32c | 5011 | format: hostname |
5dce26d2 C |
5012 | avatar: |
5013 | nullable: true | |
c1843150 | 5014 | allOf: |
75cba40d | 5015 | - $ref: '#/components/schemas/ActorImage' |
5dce26d2 C |
5016 | VideoChannelSummary: |
5017 | properties: | |
5018 | id: | |
b8375da9 | 5019 | $ref: '#/components/schemas/id' |
5dce26d2 C |
5020 | name: |
5021 | type: string | |
5022 | displayName: | |
5023 | type: string | |
5024 | url: | |
5025 | type: string | |
84f6e32c | 5026 | format: url |
5dce26d2 C |
5027 | host: |
5028 | type: string | |
84f6e32c | 5029 | format: hostname |
5dce26d2 C |
5030 | avatar: |
5031 | nullable: true | |
c1843150 | 5032 | allOf: |
75cba40d | 5033 | - $ref: '#/components/schemas/ActorImage' |
5dce26d2 C |
5034 | PlaylistElement: |
5035 | properties: | |
5036 | position: | |
06746a8b | 5037 | type: integer |
5dce26d2 | 5038 | startTimestamp: |
06746a8b | 5039 | type: integer |
c00100b6 | 5040 | format: seconds |
5dce26d2 | 5041 | stopTimestamp: |
06746a8b | 5042 | type: integer |
c00100b6 | 5043 | format: seconds |
bfbd9128 C |
5044 | video: |
5045 | nullable: true | |
c1843150 C |
5046 | allOf: |
5047 | - $ref: '#/components/schemas/Video' | |
5dce26d2 | 5048 | VideoFile: |
2c4876f2 | 5049 | readOnly: true |
5dce26d2 C |
5050 | properties: |
5051 | magnetUri: | |
5052 | type: string | |
2c4876f2 RK |
5053 | format: uri |
5054 | description: magnet URI allowing to resolve the video via BitTorrent without a metainfo file | |
5055 | 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 | |
5056 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i | |
5dce26d2 C |
5057 | resolution: |
5058 | $ref: '#/components/schemas/VideoResolutionConstant' | |
5059 | size: | |
06746a8b | 5060 | type: integer |
2c4876f2 | 5061 | description: Video file size in bytes |
5dce26d2 C |
5062 | torrentUrl: |
5063 | type: string | |
e81af300 | 5064 | description: Direct URL of the torrent file |
84f6e32c | 5065 | format: url |
0ad45af7 | 5066 | torrentDownloadUrl: |
5dce26d2 | 5067 | type: string |
e81af300 | 5068 | description: URL endpoint that transfers the torrent file as an attachment (so that the browser opens a download dialog) |
84f6e32c | 5069 | format: url |
5dce26d2 C |
5070 | fileUrl: |
5071 | type: string | |
e81af300 | 5072 | description: Direct URL of the video |
84f6e32c | 5073 | format: url |
5dce26d2 C |
5074 | fileDownloadUrl: |
5075 | type: string | |
e81af300 | 5076 | description: URL endpoint that transfers the video file as an attachment (so that the browser opens a download dialog) |
84f6e32c | 5077 | format: url |
5dce26d2 C |
5078 | fps: |
5079 | type: number | |
2c4876f2 | 5080 | description: Frames per second of the video file |
63748ad0 C |
5081 | metadataUrl: |
5082 | type: string | |
84f6e32c | 5083 | format: url |
2c4876f2 | 5084 | description: URL dereferencing the output of ffprobe on the file |
5dce26d2 | 5085 | VideoStreamingPlaylists: |
4ca669e3 RK |
5086 | allOf: |
5087 | - type: object | |
5088 | properties: | |
5089 | id: | |
b8375da9 | 5090 | $ref: '#/components/schemas/id' |
4ca669e3 RK |
5091 | type: |
5092 | type: integer | |
5093 | enum: | |
5094 | - 1 | |
5095 | description: | | |
5096 | Playlist type: | |
5097 | - `1`: HLS | |
5098 | - $ref: '#/components/schemas/VideoStreamingPlaylists-HLS' | |
5099 | VideoStreamingPlaylists-HLS: | |
5dce26d2 | 5100 | properties: |
5dce26d2 C |
5101 | playlistUrl: |
5102 | type: string | |
84f6e32c | 5103 | format: url |
5dce26d2 C |
5104 | segmentsSha256Url: |
5105 | type: string | |
84f6e32c | 5106 | format: url |
63748ad0 C |
5107 | files: |
5108 | type: array | |
c540d865 RK |
5109 | description: | |
5110 | Video files associated to this playlist. | |
5111 | ||
5112 | 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 |
5113 | items: |
5114 | $ref: '#/components/schemas/VideoFile' | |
5dce26d2 C |
5115 | redundancies: |
5116 | type: array | |
5117 | items: | |
5118 | type: object | |
5119 | properties: | |
5120 | baseUrl: | |
5121 | type: string | |
84f6e32c | 5122 | format: url |
f4d59981 RK |
5123 | VideoInfo: |
5124 | properties: | |
5125 | id: | |
b8375da9 | 5126 | $ref: '#/components/schemas/Video/properties/id' |
f4d59981 | 5127 | uuid: |
b8375da9 | 5128 | $ref: '#/components/schemas/Video/properties/uuid' |
f4d59981 | 5129 | name: |
b8375da9 | 5130 | $ref: '#/components/schemas/Video/properties/name' |
3e9e6f2f RK |
5131 | Video: |
5132 | properties: | |
5133 | id: | |
b8375da9 RK |
5134 | description: object id for the video |
5135 | allOf: | |
5136 | - $ref: '#/components/schemas/id' | |
3e9e6f2f | 5137 | uuid: |
b8375da9 RK |
5138 | description: universal identifier for the video, that can be used across instances |
5139 | allOf: | |
5140 | - $ref: '#/components/schemas/UUIDv4' | |
4e239e35 C |
5141 | isLive: |
5142 | type: boolean | |
3e9e6f2f RK |
5143 | createdAt: |
5144 | type: string | |
84f6e32c | 5145 | format: date-time |
0c114568 RK |
5146 | example: 2017-10-01T10:52:46.396Z |
5147 | description: time at which the video object was first drafted | |
3e9e6f2f RK |
5148 | publishedAt: |
5149 | type: string | |
84f6e32c | 5150 | format: date-time |
0c114568 RK |
5151 | example: 2018-10-01T10:52:46.396Z |
5152 | 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 |
5153 | updatedAt: |
5154 | type: string | |
84f6e32c | 5155 | format: date-time |
0c114568 RK |
5156 | example: 2021-05-04T08:01:01.502Z |
5157 | description: last time the video's metadata was modified | |
5dce26d2 C |
5158 | originallyPublishedAt: |
5159 | type: string | |
84f6e32c | 5160 | format: date-time |
0c114568 RK |
5161 | example: 2010-10-01T10:52:46.396Z |
5162 | description: used to represent a date of first publication, prior to the practical publication date of `publishedAt` | |
3e9e6f2f | 5163 | category: |
b8375da9 RK |
5164 | allOf: |
5165 | - $ref: '#/components/schemas/VideoConstantNumber-Category' | |
5166 | description: category in which the video is classified | |
3e9e6f2f | 5167 | licence: |
b8375da9 RK |
5168 | allOf: |
5169 | - $ref: '#/components/schemas/VideoConstantNumber-Licence' | |
5170 | description: licence under which the video is distributed | |
3e9e6f2f | 5171 | language: |
b8375da9 RK |
5172 | allOf: |
5173 | - $ref: '#/components/schemas/VideoConstantString-Language' | |
5174 | description: main language used in the video | |
3e9e6f2f | 5175 | privacy: |
b8375da9 RK |
5176 | allOf: |
5177 | - $ref: '#/components/schemas/VideoPrivacyConstant' | |
5178 | description: privacy policy used to distribute the video | |
3e9e6f2f RK |
5179 | description: |
5180 | type: string | |
0c114568 RK |
5181 | example: | |
5182 | **[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n | |
5183 | **Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network, based on fr... | |
5184 | minLength: 3 | |
5185 | maxLength: 250 | |
5186 | description: | | |
5187 | truncated description of the video, written in Markdown. | |
5188 | Resolve `descriptionPath` to get the full description of maximum `10000` characters. | |
3e9e6f2f | 5189 | duration: |
06746a8b | 5190 | type: integer |
84f6e32c | 5191 | example: 1419 |
c00100b6 | 5192 | format: seconds |
0c114568 | 5193 | description: duration of the video in seconds |
3e9e6f2f RK |
5194 | isLocal: |
5195 | type: boolean | |
5196 | name: | |
5197 | type: string | |
b8375da9 | 5198 | description: title of the video |
84f6e32c | 5199 | example: What is PeerTube? |
bdac0584 RK |
5200 | minLength: 3 |
5201 | maxLength: 120 | |
3e9e6f2f RK |
5202 | thumbnailPath: |
5203 | type: string | |
84f6e32c | 5204 | example: /static/thumbnails/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg |
3e9e6f2f RK |
5205 | previewPath: |
5206 | type: string | |
20dcfd74 | 5207 | example: /lazy-static/previews/a65bc12f-9383-462e-81ae-8207e8b434ee.jpg |
3e9e6f2f RK |
5208 | embedPath: |
5209 | type: string | |
84f6e32c | 5210 | example: /videos/embed/a65bc12f-9383-462e-81ae-8207e8b434ee |
3e9e6f2f | 5211 | views: |
06746a8b | 5212 | type: integer |
84f6e32c | 5213 | example: 1337 |
3e9e6f2f | 5214 | likes: |
06746a8b | 5215 | type: integer |
84f6e32c | 5216 | example: 42 |
3e9e6f2f | 5217 | dislikes: |
06746a8b | 5218 | type: integer |
84f6e32c | 5219 | example: 7 |
3e9e6f2f RK |
5220 | nsfw: |
5221 | type: boolean | |
5dce26d2 C |
5222 | waitTranscoding: |
5223 | type: boolean | |
5224 | nullable: true | |
5225 | state: | |
b8375da9 RK |
5226 | allOf: |
5227 | - $ref: '#/components/schemas/VideoStateConstant' | |
5228 | description: represents the internal state of the video processing within the PeerTube instance | |
5dce26d2 C |
5229 | scheduledUpdate: |
5230 | nullable: true | |
c1843150 C |
5231 | allOf: |
5232 | - $ref: '#/components/schemas/VideoScheduledUpdate' | |
5dce26d2 C |
5233 | blacklisted: |
5234 | nullable: true | |
5235 | type: boolean | |
5236 | blacklistedReason: | |
5237 | nullable: true | |
5238 | type: string | |
3e9e6f2f | 5239 | account: |
c1843150 | 5240 | $ref: '#/components/schemas/AccountSummary' |
5dce26d2 C |
5241 | channel: |
5242 | $ref: '#/components/schemas/VideoChannelSummary' | |
5243 | userHistory: | |
5244 | nullable: true | |
3e9e6f2f RK |
5245 | type: object |
5246 | properties: | |
5dce26d2 | 5247 | currentTime: |
06746a8b | 5248 | type: integer |
5dce26d2 C |
5249 | VideoDetails: |
5250 | allOf: | |
5251 | - $ref: '#/components/schemas/Video' | |
5252 | - type: object | |
5253 | properties: | |
5254 | descriptionPath: | |
3e9e6f2f | 5255 | type: string |
0c114568 RK |
5256 | example: /api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/description |
5257 | description: path at which to get the full description of maximum `10000` characters | |
5dce26d2 | 5258 | support: |
3e9e6f2f | 5259 | type: string |
00494d6e | 5260 | description: A text tell the audience how to support the video creator |
9a320a06 | 5261 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
c540d865 RK |
5262 | minLength: 3 |
5263 | maxLength: 1000 | |
5dce26d2 C |
5264 | channel: |
5265 | $ref: '#/components/schemas/VideoChannel' | |
5266 | account: | |
5267 | $ref: '#/components/schemas/Account' | |
5268 | tags: | |
bdac0584 | 5269 | example: [flowers, gardening] |
5dce26d2 | 5270 | type: array |
bdac0584 RK |
5271 | minItems: 1 |
5272 | maxItems: 5 | |
5dce26d2 C |
5273 | items: |
5274 | type: string | |
bdac0584 RK |
5275 | minLength: 2 |
5276 | maxLength: 30 | |
5dce26d2 C |
5277 | commentsEnabled: |
5278 | type: boolean | |
5279 | downloadEnabled: | |
5280 | type: boolean | |
5281 | trackerUrls: | |
5282 | type: array | |
5283 | items: | |
5284 | type: string | |
84f6e32c | 5285 | format: url |
2c4876f2 RK |
5286 | example: |
5287 | - https://peertube2.cpy.re/tracker/announce | |
5288 | - wss://peertube2.cpy.re/tracker/socket | |
c540d865 RK |
5289 | files: |
5290 | type: array | |
5291 | items: | |
5292 | $ref: '#/components/schemas/VideoFile' | |
5293 | description: | | |
5294 | WebTorrent/raw video files. If WebTorrent is disabled on the server: | |
5295 | ||
5296 | - field will be empty | |
5297 | - video files will be found in `streamingPlaylists[].files` field | |
5dce26d2 C |
5298 | streamingPlaylists: |
5299 | type: array | |
5300 | items: | |
5301 | $ref: '#/components/schemas/VideoStreamingPlaylists' | |
c540d865 RK |
5302 | description: | |
5303 | HLS playlists/manifest files. If HLS is disabled on the server: | |
5304 | ||
5305 | - field will be empty | |
5306 | - video files will be found in `files` field | |
04b703f6 RK |
5307 | FileRedundancyInformation: |
5308 | properties: | |
5309 | id: | |
b8375da9 | 5310 | $ref: '#/components/schemas/id' |
04b703f6 RK |
5311 | fileUrl: |
5312 | type: string | |
84f6e32c | 5313 | format: url |
04b703f6 RK |
5314 | strategy: |
5315 | type: string | |
84f6e32c RK |
5316 | enum: |
5317 | - manual | |
5318 | - most-views | |
5319 | - trending | |
5320 | - recently-added | |
04b703f6 RK |
5321 | size: |
5322 | type: integer | |
5323 | createdAt: | |
5324 | type: string | |
5325 | format: date-time | |
5326 | updatedAt: | |
5327 | type: string | |
5328 | format: date-time | |
5329 | expiresOn: | |
5330 | type: string | |
5331 | format: date-time | |
5332 | VideoRedundancy: | |
5333 | properties: | |
5334 | id: | |
b8375da9 | 5335 | $ref: '#/components/schemas/id' |
04b703f6 RK |
5336 | name: |
5337 | type: string | |
5338 | url: | |
5339 | type: string | |
84f6e32c | 5340 | format: url |
04b703f6 | 5341 | uuid: |
f880a5e7 | 5342 | $ref: '#/components/schemas/UUIDv4' |
04b703f6 RK |
5343 | redundancies: |
5344 | type: object | |
5345 | properties: | |
5346 | files: | |
5347 | type: array | |
5348 | items: | |
1e904cde | 5349 | $ref: '#/components/schemas/FileRedundancyInformation' |
04b703f6 RK |
5350 | streamingPlaylists: |
5351 | type: array | |
5352 | items: | |
1e904cde | 5353 | $ref: '#/components/schemas/FileRedundancyInformation' |
1f82e3e8 C |
5354 | VideoImportStateConstant: |
5355 | properties: | |
5356 | id: | |
5357 | type: integer | |
5358 | enum: | |
5359 | - 1 | |
5360 | - 2 | |
5361 | - 3 | |
06746a8b | 5362 | description: 'The video import state (Pending = `1`, Success = `2`, Failed = `3`)' |
1f82e3e8 C |
5363 | label: |
5364 | type: string | |
84f6e32c | 5365 | example: Pending |
ac2a5b54 RK |
5366 | VideoCreateImport: |
5367 | allOf: | |
5368 | - type: object | |
5369 | additionalProperties: false | |
5370 | oneOf: | |
5371 | - properties: | |
5372 | targetUrl: | |
5373 | $ref: '#/components/schemas/VideoImport/properties/targetUrl' | |
5374 | required: [targetUrl] | |
5375 | - properties: | |
5376 | magnetUri: | |
5377 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' | |
5378 | required: [magnetUri] | |
5379 | - properties: | |
5380 | torrentfile: | |
5381 | $ref: '#/components/schemas/VideoImport/properties/torrentfile' | |
5382 | required: [torrentfile] | |
5383 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
5384 | required: | |
5385 | - channelId | |
5386 | - name | |
1f82e3e8 C |
5387 | VideoImport: |
5388 | properties: | |
5389 | id: | |
ac2a5b54 RK |
5390 | readOnly: true |
5391 | allOf: | |
5392 | - $ref: '#/components/schemas/id' | |
1f82e3e8 C |
5393 | targetUrl: |
5394 | type: string | |
84f6e32c | 5395 | format: url |
2c4876f2 | 5396 | description: remote URL where to find the import's source video |
84f6e32c | 5397 | example: https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d |
1f82e3e8 C |
5398 | magnetUri: |
5399 | type: string | |
84f6e32c | 5400 | format: uri |
2c4876f2 | 5401 | description: magnet URI allowing to resolve the import's source video |
84f6e32c | 5402 | 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 | 5403 | pattern: /magnet:\?xt=urn:[a-z0-9]+:[a-z0-9]{32}/i |
ac2a5b54 RK |
5404 | torrentfile: |
5405 | writeOnly: true | |
5406 | type: string | |
5407 | format: binary | |
5408 | description: Torrent file containing only the video file | |
1f82e3e8 | 5409 | torrentName: |
ac2a5b54 | 5410 | readOnly: true |
1f82e3e8 C |
5411 | type: string |
5412 | state: | |
ac2a5b54 RK |
5413 | readOnly: true |
5414 | allOf: | |
5415 | - $ref: '#/components/schemas/VideoImportStateConstant' | |
1f82e3e8 | 5416 | error: |
ac2a5b54 | 5417 | readOnly: true |
1f82e3e8 C |
5418 | type: string |
5419 | createdAt: | |
ac2a5b54 | 5420 | readOnly: true |
1f82e3e8 | 5421 | type: string |
84f6e32c | 5422 | format: date-time |
1f82e3e8 | 5423 | updatedAt: |
ac2a5b54 | 5424 | readOnly: true |
1f82e3e8 | 5425 | type: string |
84f6e32c | 5426 | format: date-time |
1f82e3e8 | 5427 | video: |
ac2a5b54 | 5428 | readOnly: true |
2c4876f2 RK |
5429 | nullable: true |
5430 | allOf: | |
5431 | - $ref: '#/components/schemas/Video' | |
5844dde3 RK |
5432 | VideoImportsList: |
5433 | properties: | |
5434 | total: | |
5435 | type: integer | |
5436 | example: 1 | |
5437 | data: | |
5438 | type: array | |
5439 | maxItems: 100 | |
5440 | items: | |
5441 | $ref: '#/components/schemas/VideoImport' | |
668b7f09 | 5442 | Abuse: |
3e9e6f2f RK |
5443 | properties: |
5444 | id: | |
b8375da9 | 5445 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5446 | reason: |
5447 | type: string | |
84f6e32c | 5448 | example: The video is a spam |
4302058c RK |
5449 | minLength: 2 |
5450 | maxLength: 3000 | |
1ebddadd | 5451 | predefinedReasons: |
4f32032f | 5452 | $ref: '#/components/schemas/AbusePredefinedReasons' |
3e9e6f2f RK |
5453 | reporterAccount: |
5454 | $ref: '#/components/schemas/Account' | |
50e16ccf | 5455 | state: |
4f32032f | 5456 | $ref: '#/components/schemas/AbuseStateConstant' |
50e16ccf C |
5457 | moderationComment: |
5458 | type: string | |
84f6e32c | 5459 | example: Decided to ban the server since it spams us regularly |
4302058c RK |
5460 | minLength: 2 |
5461 | maxLength: 3000 | |
3e9e6f2f | 5462 | video: |
bdac0584 | 5463 | $ref: '#/components/schemas/VideoInfo' |
3e9e6f2f RK |
5464 | createdAt: |
5465 | type: string | |
84f6e32c | 5466 | format: date-time |
668b7f09 C |
5467 | AbuseMessage: |
5468 | properties: | |
5469 | id: | |
b8375da9 | 5470 | $ref: '#/components/schemas/id' |
668b7f09 C |
5471 | message: |
5472 | type: string | |
4302058c | 5473 | minLength: 2 |
f6d6e7f8 | 5474 | maxLength: 3000 |
668b7f09 C |
5475 | byModerator: |
5476 | type: boolean | |
5477 | createdAt: | |
5478 | type: string | |
5479 | format: date-time | |
5480 | account: | |
5481 | $ref: '#/components/schemas/AccountSummary' | |
3e9e6f2f RK |
5482 | VideoBlacklist: |
5483 | properties: | |
5484 | id: | |
b8375da9 | 5485 | $ref: '#/components/schemas/id' |
3e9e6f2f | 5486 | videoId: |
b8375da9 | 5487 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f RK |
5488 | createdAt: |
5489 | type: string | |
84f6e32c | 5490 | format: date-time |
3e9e6f2f RK |
5491 | updatedAt: |
5492 | type: string | |
84f6e32c | 5493 | format: date-time |
3e9e6f2f RK |
5494 | name: |
5495 | type: string | |
4302058c RK |
5496 | minLength: 3 |
5497 | maxLength: 120 | |
3e9e6f2f | 5498 | uuid: |
f880a5e7 | 5499 | $ref: '#/components/schemas/UUIDv4' |
3e9e6f2f RK |
5500 | description: |
5501 | type: string | |
4302058c RK |
5502 | minLength: 3 |
5503 | maxLength: 10000 | |
3e9e6f2f | 5504 | duration: |
06746a8b | 5505 | type: integer |
3e9e6f2f | 5506 | views: |
06746a8b | 5507 | type: integer |
3e9e6f2f | 5508 | likes: |
06746a8b | 5509 | type: integer |
3e9e6f2f | 5510 | dislikes: |
06746a8b | 5511 | type: integer |
3e9e6f2f RK |
5512 | nsfw: |
5513 | type: boolean | |
71810d0b RK |
5514 | VideoPlaylist: |
5515 | properties: | |
5516 | id: | |
b8375da9 RK |
5517 | $ref: '#/components/schemas/id' |
5518 | uuid: | |
5519 | $ref: '#/components/schemas/UUIDv4' | |
71810d0b RK |
5520 | createdAt: |
5521 | type: string | |
84f6e32c | 5522 | format: date-time |
71810d0b RK |
5523 | updatedAt: |
5524 | type: string | |
84f6e32c | 5525 | format: date-time |
71810d0b RK |
5526 | description: |
5527 | type: string | |
4302058c RK |
5528 | minLength: 3 |
5529 | maxLength: 1000 | |
71810d0b RK |
5530 | displayName: |
5531 | type: string | |
4302058c RK |
5532 | minLength: 1 |
5533 | maxLength: 120 | |
71810d0b RK |
5534 | isLocal: |
5535 | type: boolean | |
5536 | videoLength: | |
06746a8b | 5537 | type: integer |
b8375da9 | 5538 | minimum: 0 |
71810d0b RK |
5539 | thumbnailPath: |
5540 | type: string | |
5541 | privacy: | |
c1843150 | 5542 | $ref: '#/components/schemas/VideoPlaylistPrivacyConstant' |
71810d0b | 5543 | type: |
c1843150 | 5544 | $ref: '#/components/schemas/VideoPlaylistTypeConstant' |
71810d0b | 5545 | ownerAccount: |
c1843150 C |
5546 | $ref: '#/components/schemas/AccountSummary' |
5547 | videoChannel: | |
5548 | $ref: '#/components/schemas/VideoChannelSummary' | |
3e9e6f2f RK |
5549 | VideoComment: |
5550 | properties: | |
5551 | id: | |
b8375da9 | 5552 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5553 | url: |
5554 | type: string | |
84f6e32c | 5555 | format: url |
3e9e6f2f RK |
5556 | text: |
5557 | type: string | |
bf3c3fea RK |
5558 | format: html |
5559 | description: Text of the comment | |
4302058c | 5560 | minLength: 1 |
bf3c3fea | 5561 | example: This video is wonderful! |
3e9e6f2f | 5562 | threadId: |
b8375da9 | 5563 | $ref: '#/components/schemas/id' |
bf3c3fea RK |
5564 | inReplyToCommentId: |
5565 | nullable: true | |
5566 | allOf: | |
5567 | - $ref: '#/components/schemas/id' | |
3e9e6f2f | 5568 | videoId: |
b8375da9 | 5569 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f RK |
5570 | createdAt: |
5571 | type: string | |
84f6e32c | 5572 | format: date-time |
3e9e6f2f RK |
5573 | updatedAt: |
5574 | type: string | |
84f6e32c | 5575 | format: date-time |
bf3c3fea RK |
5576 | deletedAt: |
5577 | nullable: true | |
5578 | type: string | |
5579 | format: date-time | |
5580 | default: null | |
5581 | isDeleted: | |
5582 | type: boolean | |
5583 | default: false | |
5b0413dd | 5584 | totalRepliesFromVideoAuthor: |
06746a8b | 5585 | type: integer |
b8375da9 | 5586 | minimum: 0 |
3e9e6f2f | 5587 | totalReplies: |
06746a8b | 5588 | type: integer |
b8375da9 | 5589 | minimum: 0 |
3e9e6f2f RK |
5590 | account: |
5591 | $ref: '#/components/schemas/Account' | |
5592 | VideoCommentThreadTree: | |
5593 | properties: | |
5594 | comment: | |
5595 | $ref: '#/components/schemas/VideoComment' | |
5596 | children: | |
5597 | type: array | |
5598 | items: | |
5599 | $ref: '#/components/schemas/VideoCommentThreadTree' | |
67ae04a5 C |
5600 | VideoCaption: |
5601 | properties: | |
5602 | language: | |
dfcb6f50 | 5603 | $ref: '#/components/schemas/VideoConstantString-Language' |
67ae04a5 C |
5604 | captionPath: |
5605 | type: string | |
75cba40d | 5606 | ActorImage: |
3e9e6f2f RK |
5607 | properties: |
5608 | path: | |
5609 | type: string | |
5610 | createdAt: | |
5611 | type: string | |
84f6e32c | 5612 | format: date-time |
3e9e6f2f RK |
5613 | updatedAt: |
5614 | type: string | |
84f6e32c | 5615 | format: date-time |
f4d59981 RK |
5616 | ActorInfo: |
5617 | properties: | |
5618 | id: | |
b8375da9 | 5619 | $ref: '#/components/schemas/id' |
f4d59981 RK |
5620 | name: |
5621 | type: string | |
5622 | displayName: | |
5623 | type: string | |
5624 | host: | |
5625 | type: string | |
84f6e32c | 5626 | format: hostname |
f4d59981 RK |
5627 | avatar: |
5628 | nullable: true | |
5629 | type: object | |
5630 | properties: | |
5631 | path: | |
5632 | type: string | |
3e9e6f2f RK |
5633 | Actor: |
5634 | properties: | |
5635 | id: | |
b8375da9 | 5636 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
5637 | url: |
5638 | type: string | |
84f6e32c | 5639 | format: url |
3e9e6f2f | 5640 | name: |
77b0c6b5 | 5641 | description: immutable name of the actor, used to find or mention it |
2c4876f2 RK |
5642 | allOf: |
5643 | - $ref: '#/components/schemas/username' | |
3e9e6f2f RK |
5644 | host: |
5645 | type: string | |
84f6e32c | 5646 | format: hostname |
2c4876f2 | 5647 | description: server on which the actor is resident |
045bcd0d RK |
5648 | hostRedundancyAllowed: |
5649 | type: boolean | |
2c4876f2 | 5650 | description: whether this actor's host allows redundancy of its videos |
3e9e6f2f | 5651 | followingCount: |
06746a8b | 5652 | type: integer |
2c4876f2 RK |
5653 | minimum: 0 |
5654 | description: number of actors subscribed to by this actor, as seen by this instance | |
3e9e6f2f | 5655 | followersCount: |
06746a8b | 5656 | type: integer |
2c4876f2 RK |
5657 | minimum: 0 |
5658 | description: number of followers of this actor, as seen by this instance | |
3e9e6f2f RK |
5659 | createdAt: |
5660 | type: string | |
84f6e32c | 5661 | format: date-time |
3e9e6f2f RK |
5662 | updatedAt: |
5663 | type: string | |
84f6e32c | 5664 | format: date-time |
3e9e6f2f | 5665 | avatar: |
75cba40d | 5666 | $ref: '#/components/schemas/ActorImage' |
3e9e6f2f RK |
5667 | Account: |
5668 | allOf: | |
5669 | - $ref: '#/components/schemas/Actor' | |
5670 | - properties: | |
2a8ae759 | 5671 | userId: |
2c4876f2 RK |
5672 | description: object id for the user tied to this account |
5673 | allOf: | |
5674 | - $ref: '#/components/schemas/User/properties/id' | |
3e9e6f2f RK |
5675 | displayName: |
5676 | type: string | |
77b0c6b5 RK |
5677 | description: editable name of the account, displayed in its representations |
5678 | minLength: 3 | |
5679 | maxLength: 120 | |
2a8ae759 FS |
5680 | description: |
5681 | type: string | |
2c4876f2 | 5682 | description: text or bio displayed on the account's profile |
6441981b RK |
5683 | UserWatchingVideo: |
5684 | properties: | |
5685 | currentTime: | |
06746a8b | 5686 | type: integer |
c00100b6 | 5687 | format: seconds |
84f6e32c RK |
5688 | description: timestamp within the video, in seconds |
5689 | example: 5 | |
3e9e6f2f RK |
5690 | ServerConfig: |
5691 | properties: | |
2a8ae759 FS |
5692 | instance: |
5693 | type: object | |
5694 | properties: | |
5695 | name: | |
5696 | type: string | |
5697 | shortDescription: | |
5698 | type: string | |
5699 | defaultClientRoute: | |
5700 | type: string | |
5701 | isNSFW: | |
5702 | type: boolean | |
5703 | defaultNSFWPolicy: | |
5704 | type: string | |
5705 | customizations: | |
5706 | type: object | |
5707 | properties: | |
5708 | javascript: | |
5709 | type: string | |
5710 | css: | |
5711 | type: string | |
f30736c8 RK |
5712 | search: |
5713 | type: object | |
5714 | properties: | |
5715 | remoteUri: | |
5716 | type: object | |
5717 | properties: | |
5718 | users: | |
5719 | type: boolean | |
5720 | anonymous: | |
5721 | type: boolean | |
2a8ae759 FS |
5722 | plugin: |
5723 | type: object | |
5724 | properties: | |
5725 | registered: | |
5726 | type: array | |
5727 | items: | |
5728 | type: string | |
5729 | theme: | |
5730 | type: object | |
5731 | properties: | |
5732 | registered: | |
5733 | type: array | |
5734 | items: | |
5735 | type: string | |
5736 | email: | |
5737 | type: object | |
5738 | properties: | |
5739 | enabled: | |
5740 | type: boolean | |
5741 | contactForm: | |
5742 | type: object | |
5743 | properties: | |
5744 | enabled: | |
5745 | type: boolean | |
5746 | serverVersion: | |
5747 | type: string | |
5748 | serverCommit: | |
5749 | type: string | |
3e9e6f2f RK |
5750 | signup: |
5751 | type: object | |
5752 | properties: | |
5753 | allowed: | |
5754 | type: boolean | |
2a8ae759 FS |
5755 | allowedForCurrentIP: |
5756 | type: boolean | |
5757 | requiresEmailVerification: | |
5758 | type: boolean | |
3e9e6f2f RK |
5759 | transcoding: |
5760 | type: object | |
5761 | properties: | |
2a8ae759 FS |
5762 | hls: |
5763 | type: object | |
5764 | properties: | |
5765 | enabled: | |
5766 | type: boolean | |
f30736c8 RK |
5767 | webtorrent: |
5768 | type: object | |
5769 | properties: | |
5770 | enabled: | |
5771 | type: boolean | |
3e9e6f2f RK |
5772 | enabledResolutions: |
5773 | type: array | |
5774 | items: | |
40cfb36b | 5775 | $ref: '#/components/schemas/VideoResolutionSet' |
2a8ae759 FS |
5776 | import: |
5777 | type: object | |
5778 | properties: | |
5779 | videos: | |
5780 | type: object | |
5781 | properties: | |
5782 | http: | |
5783 | type: object | |
5784 | properties: | |
5785 | enabled: | |
5786 | type: boolean | |
5787 | torrent: | |
5788 | type: object | |
5789 | properties: | |
5790 | enabled: | |
5791 | type: boolean | |
5792 | autoBlacklist: | |
5793 | type: object | |
5794 | properties: | |
5795 | videos: | |
5796 | type: object | |
5797 | properties: | |
5798 | ofUsers: | |
5799 | type: object | |
5800 | properties: | |
5801 | enabled: | |
5802 | type: boolean | |
3e9e6f2f RK |
5803 | avatar: |
5804 | type: object | |
5805 | properties: | |
5806 | file: | |
5807 | type: object | |
5808 | properties: | |
5809 | size: | |
5810 | type: object | |
5811 | properties: | |
5812 | max: | |
06746a8b | 5813 | type: integer |
3e9e6f2f RK |
5814 | extensions: |
5815 | type: array | |
5816 | items: | |
5817 | type: string | |
5818 | video: | |
5819 | type: object | |
5820 | properties: | |
2a8ae759 FS |
5821 | image: |
5822 | type: object | |
5823 | properties: | |
5824 | extensions: | |
5825 | type: array | |
5826 | items: | |
5827 | type: string | |
5828 | size: | |
5829 | type: object | |
5830 | properties: | |
5831 | max: | |
06746a8b | 5832 | type: integer |
3e9e6f2f RK |
5833 | file: |
5834 | type: object | |
5835 | properties: | |
5836 | extensions: | |
5837 | type: array | |
5838 | items: | |
5839 | type: string | |
2a8ae759 FS |
5840 | videoCaption: |
5841 | type: object | |
5842 | properties: | |
5843 | file: | |
5844 | type: object | |
5845 | properties: | |
5846 | size: | |
5847 | type: object | |
5848 | properties: | |
5849 | max: | |
06746a8b | 5850 | type: integer |
2a8ae759 FS |
5851 | extensions: |
5852 | type: array | |
5853 | items: | |
5854 | type: string | |
5855 | user: | |
5856 | type: object | |
5857 | properties: | |
5858 | videoQuota: | |
06746a8b | 5859 | type: integer |
b8375da9 | 5860 | example: 16810141515 |
2a8ae759 | 5861 | videoQuotaDaily: |
06746a8b | 5862 | type: integer |
b8375da9 | 5863 | example: 1681014151 |
2a8ae759 FS |
5864 | trending: |
5865 | type: object | |
5866 | properties: | |
5867 | videos: | |
5868 | type: object | |
5869 | properties: | |
5870 | intervalDays: | |
06746a8b | 5871 | type: integer |
2a8ae759 | 5872 | tracker: |
747b17c7 | 5873 | type: object |
2a8ae759 FS |
5874 | properties: |
5875 | enabled: | |
5876 | type: boolean | |
f30736c8 RK |
5877 | followings: |
5878 | type: object | |
5879 | properties: | |
5880 | instance: | |
5881 | type: object | |
5882 | properties: | |
5883 | autoFollowIndex: | |
5884 | type: object | |
5885 | properties: | |
5886 | indexUrl: | |
5887 | type: string | |
84f6e32c | 5888 | format: url |
2539932e C |
5889 | homepage: |
5890 | type: object | |
5891 | properties: | |
5892 | enabled: | |
5893 | type: boolean | |
5894 | ||
2a8ae759 FS |
5895 | ServerConfigAbout: |
5896 | properties: | |
5897 | instance: | |
5898 | type: object | |
5899 | properties: | |
5900 | name: | |
5901 | type: string | |
5902 | shortDescription: | |
5903 | type: string | |
5904 | description: | |
5905 | type: string | |
5906 | terms: | |
5907 | type: string | |
5908 | ServerConfigCustom: | |
5909 | properties: | |
5910 | instance: | |
5911 | type: object | |
5912 | properties: | |
5913 | name: | |
5914 | type: string | |
5915 | shortDescription: | |
5916 | type: string | |
5917 | description: | |
5918 | type: string | |
5919 | terms: | |
5920 | type: string | |
5921 | defaultClientRoute: | |
5922 | type: string | |
5923 | isNSFW: | |
5924 | type: boolean | |
5925 | defaultNSFWPolicy: | |
5926 | type: string | |
5927 | customizations: | |
5928 | type: object | |
5929 | properties: | |
5930 | javascript: | |
5931 | type: string | |
5932 | css: | |
5933 | type: string | |
5934 | theme: | |
5935 | type: object | |
5936 | properties: | |
5937 | default: | |
5938 | type: string | |
5939 | services: | |
5940 | type: object | |
5941 | properties: | |
5942 | twitter: | |
5943 | type: object | |
5944 | properties: | |
5945 | username: | |
5946 | type: string | |
5947 | whitelisted: | |
5948 | type: boolean | |
5949 | cache: | |
5950 | type: object | |
5951 | properties: | |
5952 | previews: | |
5953 | type: object | |
5954 | properties: | |
5955 | size: | |
06746a8b | 5956 | type: integer |
2a8ae759 FS |
5957 | captions: |
5958 | type: object | |
5959 | properties: | |
5960 | size: | |
06746a8b | 5961 | type: integer |
2a8ae759 FS |
5962 | signup: |
5963 | type: object | |
5964 | properties: | |
5965 | enabled: | |
5966 | type: boolean | |
5967 | limit: | |
06746a8b | 5968 | type: integer |
2a8ae759 FS |
5969 | requiresEmailVerification: |
5970 | type: boolean | |
5971 | admin: | |
5972 | type: object | |
5973 | properties: | |
5974 | email: | |
5975 | type: string | |
84f6e32c | 5976 | format: email |
2a8ae759 FS |
5977 | contactForm: |
5978 | type: object | |
5979 | properties: | |
5980 | enabled: | |
5981 | type: boolean | |
5982 | user: | |
5983 | type: object | |
40cfb36b | 5984 | description: Settings that apply to new users, if registration is enabled |
2a8ae759 FS |
5985 | properties: |
5986 | videoQuota: | |
06746a8b | 5987 | type: integer |
b8375da9 | 5988 | example: 16810141515 |
2a8ae759 | 5989 | videoQuotaDaily: |
06746a8b | 5990 | type: integer |
b8375da9 | 5991 | example: 1681014151 |
2a8ae759 FS |
5992 | transcoding: |
5993 | type: object | |
40cfb36b | 5994 | description: Settings pertaining to transcoding jobs |
2a8ae759 FS |
5995 | properties: |
5996 | enabled: | |
5997 | type: boolean | |
5998 | allowAdditionalExtensions: | |
5999 | type: boolean | |
40cfb36b | 6000 | description: Allow your users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, m2ts, .mxf, .nut videos |
2a8ae759 FS |
6001 | allowAudioFiles: |
6002 | type: boolean | |
40cfb36b | 6003 | description: If a user uploads an audio file, PeerTube will create a video by merging the preview file and the audio file |
2a8ae759 | 6004 | threads: |
06746a8b | 6005 | type: integer |
40cfb36b RK |
6006 | description: Amount of threads used by ffmpeg for 1 transcoding job |
6007 | concurrency: | |
6008 | type: number | |
6009 | description: Amount of transcoding jobs to execute in parallel | |
6010 | profile: | |
6011 | type: string | |
6012 | enum: | |
6013 | - default | |
6014 | description: | | |
6015 | New profiles can be added by plugins ; available in core PeerTube: 'default'. | |
2a8ae759 FS |
6016 | resolutions: |
6017 | type: object | |
40cfb36b | 6018 | description: Resolutions to transcode _new videos_ to |
2a8ae759 | 6019 | properties: |
40cfb36b RK |
6020 | 0p: |
6021 | type: boolean | |
2a8ae759 FS |
6022 | 240p: |
6023 | type: boolean | |
6024 | 360p: | |
6025 | type: boolean | |
6026 | 480p: | |
6027 | type: boolean | |
6028 | 720p: | |
6029 | type: boolean | |
6030 | 1080p: | |
6031 | type: boolean | |
b7085c71 RK |
6032 | 1440p: |
6033 | type: boolean | |
2a8ae759 FS |
6034 | 2160p: |
6035 | type: boolean | |
40cfb36b RK |
6036 | webtorrent: |
6037 | type: object | |
6038 | description: WebTorrent-specific settings | |
6039 | properties: | |
6040 | enabled: | |
6041 | type: boolean | |
2a8ae759 FS |
6042 | hls: |
6043 | type: object | |
40cfb36b | 6044 | description: HLS-specific settings |
2a8ae759 FS |
6045 | properties: |
6046 | enabled: | |
6047 | type: boolean | |
6048 | import: | |
6049 | type: object | |
6050 | properties: | |
6051 | videos: | |
6052 | type: object | |
6053 | properties: | |
6054 | http: | |
6055 | type: object | |
6056 | properties: | |
6057 | enabled: | |
6058 | type: boolean | |
6059 | torrent: | |
6060 | type: object | |
6061 | properties: | |
6062 | enabled: | |
6063 | type: boolean | |
6064 | autoBlacklist: | |
6065 | type: object | |
6066 | properties: | |
6067 | videos: | |
6068 | type: object | |
6069 | properties: | |
6070 | ofUsers: | |
6071 | type: object | |
6072 | properties: | |
6073 | enabled: | |
6074 | type: boolean | |
6075 | followers: | |
6076 | type: object | |
6077 | properties: | |
6078 | instance: | |
6079 | type: object | |
6080 | properties: | |
6081 | enabled: | |
6082 | type: boolean | |
6083 | manualApproval: | |
6084 | type: boolean | |
2539932e C |
6085 | |
6086 | CustomHomepage: | |
6087 | properties: | |
6088 | content: | |
6089 | type: string | |
6090 | ||
3e9e6f2f RK |
6091 | Follow: |
6092 | properties: | |
6093 | id: | |
b8375da9 | 6094 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
6095 | follower: |
6096 | $ref: '#/components/schemas/Actor' | |
6097 | following: | |
6098 | $ref: '#/components/schemas/Actor' | |
6099 | score: | |
6100 | type: number | |
04b703f6 | 6101 | description: score reflecting the reachability of the actor, with steps of `10` and a base score of `1000`. |
3e9e6f2f RK |
6102 | state: |
6103 | type: string | |
6104 | enum: | |
6105 | - pending | |
6106 | - accepted | |
6107 | createdAt: | |
6108 | type: string | |
84f6e32c | 6109 | format: date-time |
3e9e6f2f RK |
6110 | updatedAt: |
6111 | type: string | |
84f6e32c | 6112 | format: date-time |
e3489df9 C |
6113 | |
6114 | PredefinedAbuseReasons: | |
6115 | description: Reason categories that help triage reports | |
6116 | type: array | |
f6d6e7f8 | 6117 | maxItems: 8 |
e3489df9 C |
6118 | items: |
6119 | type: string | |
6120 | enum: | |
6121 | - violentOrAbusive | |
6122 | - hatefulOrAbusive | |
6123 | - spamOrMisleading | |
6124 | - privacy | |
6125 | - rights | |
6126 | - serverRules | |
6127 | - thumbnails | |
6128 | - captions | |
6129 | ||
3e9e6f2f RK |
6130 | Job: |
6131 | properties: | |
6132 | id: | |
b8375da9 | 6133 | $ref: '#/components/schemas/id' |
3e9e6f2f RK |
6134 | state: |
6135 | type: string | |
6136 | enum: | |
84f6e32c RK |
6137 | - active |
6138 | - completed | |
6139 | - failed | |
6140 | - waiting | |
6141 | - delayed | |
6142 | type: | |
3e9e6f2f RK |
6143 | type: string |
6144 | enum: | |
84f6e32c RK |
6145 | - activitypub-http-unicast |
6146 | - activitypub-http-broadcast | |
6147 | - activitypub-http-fetcher | |
6148 | - activitypub-follow | |
6149 | - video-file-import | |
6150 | - video-transcoding | |
6151 | ||
6152 | - video-import | |
6153 | - videos-views | |
6154 | - activitypub-refresher | |
6155 | - video-redundancy | |
6156 | data: | |
6157 | type: object | |
6158 | additionalProperties: true | |
6159 | error: | |
6160 | type: object | |
6161 | additionalProperties: true | |
3e9e6f2f RK |
6162 | createdAt: |
6163 | type: string | |
84f6e32c RK |
6164 | format: date-time |
6165 | finishedOn: | |
3e9e6f2f | 6166 | type: string |
84f6e32c RK |
6167 | format: date-time |
6168 | processedOn: | |
6169 | type: string | |
6170 | format: date-time | |
3e9e6f2f RK |
6171 | AddUserResponse: |
6172 | properties: | |
2c318664 RK |
6173 | user: |
6174 | type: object | |
6175 | properties: | |
6176 | id: | |
b8375da9 | 6177 | $ref: '#/components/schemas/id' |
2c318664 RK |
6178 | account: |
6179 | type: object | |
6180 | properties: | |
6181 | id: | |
b8375da9 | 6182 | $ref: '#/components/schemas/id' |
f6d6e7f8 | 6183 | VideoUploadRequestCommon: |
6184 | properties: | |
6185 | name: | |
6186 | description: Video name | |
6187 | type: string | |
b8375da9 RK |
6188 | example: What is PeerTube? |
6189 | minLength: 3 | |
6190 | maxLength: 120 | |
f6d6e7f8 | 6191 | channelId: |
6192 | description: Channel id that will contain this video | |
6193 | type: integer | |
b8375da9 RK |
6194 | example: 3 |
6195 | minimum: 1 | |
f6d6e7f8 | 6196 | privacy: |
6197 | $ref: '#/components/schemas/VideoPrivacySet' | |
6198 | category: | |
40cfb36b | 6199 | $ref: '#/components/schemas/VideoCategorySet' |
f6d6e7f8 | 6200 | licence: |
40cfb36b | 6201 | $ref: '#/components/schemas/VideoLicenceSet' |
f6d6e7f8 | 6202 | language: |
40cfb36b | 6203 | $ref: '#/components/schemas/VideoLanguageSet' |
f6d6e7f8 | 6204 | description: |
6205 | description: Video description | |
6206 | type: string | |
b8375da9 RK |
6207 | example: | |
6208 | **[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 | 6209 | waitTranscoding: |
6210 | description: Whether or not we wait transcoding before publish the video | |
6211 | type: boolean | |
6212 | support: | |
6213 | description: A text tell the audience how to support the video creator | |
9a320a06 | 6214 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
f6d6e7f8 | 6215 | type: string |
6216 | nsfw: | |
6217 | description: Whether or not this video contains sensitive content | |
6218 | type: boolean | |
6219 | tags: | |
6220 | description: Video tags (maximum 5 tags each between 2 and 30 characters) | |
6221 | type: array | |
6222 | minItems: 1 | |
6223 | maxItems: 5 | |
6224 | uniqueItems: true | |
b8375da9 RK |
6225 | example: |
6226 | - framasoft | |
6227 | - peertube | |
f6d6e7f8 | 6228 | items: |
6229 | type: string | |
6230 | minLength: 2 | |
6231 | maxLength: 30 | |
6232 | commentsEnabled: | |
6233 | description: Enable or disable comments for this video | |
6234 | type: boolean | |
6235 | downloadEnabled: | |
6236 | description: Enable or disable downloading for this video | |
6237 | type: boolean | |
6238 | originallyPublishedAt: | |
6239 | description: Date when the content was originally published | |
6240 | type: string | |
6241 | format: date-time | |
6242 | scheduleUpdate: | |
6243 | $ref: '#/components/schemas/VideoScheduledUpdate' | |
6244 | thumbnailfile: | |
6245 | description: Video thumbnail file | |
6246 | type: string | |
6247 | format: binary | |
6248 | previewfile: | |
6249 | description: Video preview file | |
6250 | type: string | |
6251 | format: binary | |
6252 | required: | |
6253 | - channelId | |
6254 | - name | |
6255 | VideoUploadRequestLegacy: | |
6256 | allOf: | |
6257 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6258 | - type: object | |
6259 | required: | |
6260 | - videofile | |
6261 | properties: | |
6262 | videofile: | |
6263 | description: Video file | |
6264 | type: string | |
6265 | format: binary | |
6266 | VideoUploadRequestResumable: | |
6267 | allOf: | |
6268 | - $ref: '#/components/schemas/VideoUploadRequestCommon' | |
6269 | - type: object | |
6270 | required: | |
6271 | - filename | |
6272 | properties: | |
6273 | filename: | |
6274 | description: Video filename including extension | |
6275 | type: string | |
6276 | format: filename | |
b8375da9 | 6277 | example: what_is_peertube.mp4 |
f6d6e7f8 | 6278 | thumbnailfile: |
6279 | description: Video thumbnail file | |
6280 | type: string | |
6281 | format: binary | |
6282 | previewfile: | |
6283 | description: Video preview file | |
6284 | type: string | |
6285 | format: binary | |
3e9e6f2f RK |
6286 | VideoUploadResponse: |
6287 | properties: | |
6288 | video: | |
6289 | type: object | |
6290 | properties: | |
6291 | id: | |
b8375da9 | 6292 | $ref: '#/components/schemas/Video/properties/id' |
3e9e6f2f | 6293 | uuid: |
b8375da9 | 6294 | $ref: '#/components/schemas/Video/properties/uuid' |
3e9e6f2f RK |
6295 | CommentThreadResponse: |
6296 | properties: | |
6297 | total: | |
06746a8b | 6298 | type: integer |
84f6e32c | 6299 | example: 1 |
3e9e6f2f RK |
6300 | data: |
6301 | type: array | |
84f6e32c | 6302 | maxItems: 100 |
3e9e6f2f RK |
6303 | items: |
6304 | $ref: '#/components/schemas/VideoComment' | |
6305 | CommentThreadPostResponse: | |
6306 | properties: | |
6307 | comment: | |
6308 | $ref: '#/components/schemas/VideoComment' | |
048b6946 C |
6309 | VideoListResponse: |
6310 | properties: | |
6311 | total: | |
06746a8b | 6312 | type: integer |
84f6e32c | 6313 | example: 1 |
048b6946 C |
6314 | data: |
6315 | type: array | |
84f6e32c | 6316 | maxItems: 100 |
048b6946 C |
6317 | items: |
6318 | $ref: '#/components/schemas/Video' | |
84f6e32c RK |
6319 | User: |
6320 | properties: | |
fd5586b3 RK |
6321 | account: |
6322 | $ref: '#/components/schemas/Account' | |
6323 | autoPlayNextVideo: | |
6324 | type: boolean | |
6325 | description: Automatically start playing the upcoming video after the currently playing video | |
6326 | autoPlayNextVideoPlaylist: | |
6327 | type: boolean | |
6328 | description: Automatically start playing the video on the playlist after the currently playing video | |
6329 | autoPlayVideo: | |
6330 | type: boolean | |
6331 | description: Automatically start playing the video on the watch page | |
6332 | blocked: | |
6333 | type: boolean | |
6334 | blockedReason: | |
6335 | type: string | |
6336 | createdAt: | |
84f6e32c | 6337 | type: string |
84f6e32c RK |
6338 | email: |
6339 | type: string | |
6340 | format: email | |
6341 | description: The user email | |
fd5586b3 RK |
6342 | emailVerified: |
6343 | type: boolean | |
6344 | description: Has the user confirmed their email address? | |
6345 | id: | |
2c4876f2 RK |
6346 | allOf: |
6347 | - $ref: '#/components/schemas/id' | |
fd5586b3 | 6348 | readOnly: true |
6d989edc C |
6349 | pluginAuth: |
6350 | type: string | |
6351 | description: Auth plugin to use to authenticate the user | |
fd5586b3 | 6352 | lastLoginDate: |
84f6e32c | 6353 | type: string |
fd5586b3 RK |
6354 | format: date-time |
6355 | noInstanceConfigWarningModal: | |
6356 | type: boolean | |
6357 | noWelcomeModal: | |
84f6e32c | 6358 | type: boolean |
84f6e32c RK |
6359 | nsfwPolicy: |
6360 | $ref: '#/components/schemas/NSFWPolicy' | |
84f6e32c RK |
6361 | role: |
6362 | $ref: '#/components/schemas/UserRole' | |
6363 | roleLabel: | |
6364 | type: string | |
6365 | enum: | |
6366 | - User | |
6367 | - Moderator | |
6368 | - Administrator | |
fd5586b3 | 6369 | theme: |
84f6e32c | 6370 | type: string |
fd5586b3 RK |
6371 | description: Theme enabled by this user |
6372 | username: | |
b8375da9 | 6373 | $ref: '#/components/schemas/username' |
84f6e32c RK |
6374 | videoChannels: |
6375 | type: array | |
6376 | items: | |
6377 | $ref: '#/components/schemas/VideoChannel' | |
fd5586b3 RK |
6378 | videoQuota: |
6379 | type: integer | |
6380 | description: The user video quota in bytes | |
6381 | example: -1 | |
6382 | videoQuotaDaily: | |
6383 | type: integer | |
6384 | description: The user daily video quota in bytes | |
6385 | example: -1 | |
6386 | webtorrentEnabled: | |
6387 | type: boolean | |
6388 | description: Enable P2P in the player | |
6389 | UserWithStats: | |
6390 | allOf: | |
6391 | - $ref: '#/components/schemas/User' | |
6392 | - properties: | |
6393 | # optionally present fields: they require WITH_STATS scope | |
6394 | videosCount: | |
6395 | type: integer | |
85a60d8b | 6396 | description: Count of videos published |
fd5586b3 RK |
6397 | abusesCount: |
6398 | type: integer | |
6399 | description: Count of reports/abuses of which the user is a target | |
6400 | abusesAcceptedCount: | |
6401 | type: integer | |
6402 | description: Count of reports/abuses created by the user and accepted/acted upon by the moderation team | |
6403 | abusesCreatedCount: | |
6404 | type: integer | |
6405 | description: Count of reports/abuses created by the user | |
6406 | videoCommentsCount: | |
6407 | type: integer | |
6408 | description: Count of comments published | |
3e9e6f2f RK |
6409 | AddUser: |
6410 | properties: | |
6411 | username: | |
b8375da9 | 6412 | $ref: '#/components/schemas/username' |
3e9e6f2f | 6413 | password: |
b8375da9 | 6414 | $ref: '#/components/schemas/password' |
3e9e6f2f RK |
6415 | email: |
6416 | type: string | |
84f6e32c RK |
6417 | format: email |
6418 | description: The user email | |
3e9e6f2f | 6419 | videoQuota: |
84f6e32c | 6420 | type: integer |
b8375da9 RK |
6421 | description: The user video quota in bytes |
6422 | example: -1 | |
fbe1bc2a | 6423 | videoQuotaDaily: |
84f6e32c | 6424 | type: integer |
b8375da9 RK |
6425 | description: The user daily video quota in bytes |
6426 | example: -1 | |
6d989edc | 6427 | channelName: |
b8375da9 | 6428 | $ref: '#/components/schemas/usernameChannel' |
3e9e6f2f | 6429 | role: |
0590bb46 | 6430 | $ref: '#/components/schemas/UserRole' |
6d989edc C |
6431 | adminFlags: |
6432 | $ref: '#/components/schemas/UserAdminFlags' | |
3e9e6f2f RK |
6433 | required: |
6434 | - username | |
6435 | - password | |
6436 | ||
6437 | - videoQuota | |
fbe1bc2a | 6438 | - videoQuotaDaily |
3e9e6f2f RK |
6439 | - role |
6440 | UpdateUser: | |
6441 | properties: | |
3e9e6f2f | 6442 | email: |
84f6e32c | 6443 | description: The updated email of the user |
77b0c6b5 RK |
6444 | allOf: |
6445 | - $ref: '#/components/schemas/User/properties/email' | |
6d989edc C |
6446 | emailVerified: |
6447 | type: boolean | |
6448 | description: Set the email as verified | |
3e9e6f2f | 6449 | videoQuota: |
84f6e32c | 6450 | type: integer |
b8375da9 | 6451 | description: The updated video quota of the user in bytes |
fbe1bc2a | 6452 | videoQuotaDaily: |
84f6e32c | 6453 | type: integer |
b8375da9 | 6454 | description: The updated daily video quota of the user in bytes |
6d989edc C |
6455 | pluginAuth: |
6456 | type: string | |
6457 | nullable: true | |
6458 | description: The auth plugin to use to authenticate the user | |
6459 | example: 'peertube-plugin-auth-saml2' | |
3e9e6f2f | 6460 | role: |
0590bb46 | 6461 | $ref: '#/components/schemas/UserRole' |
6d989edc C |
6462 | adminFlags: |
6463 | $ref: '#/components/schemas/UserAdminFlags' | |
3e9e6f2f | 6464 | UpdateMe: |
77b0c6b5 | 6465 | # see shared/models/users/user-update-me.model.ts: |
3e9e6f2f RK |
6466 | properties: |
6467 | password: | |
b8375da9 | 6468 | $ref: '#/components/schemas/password' |
77b0c6b5 RK |
6469 | currentPassword: |
6470 | $ref: '#/components/schemas/password' | |
3e9e6f2f | 6471 | email: |
77b0c6b5 RK |
6472 | description: new email used for login and service communications |
6473 | allOf: | |
6474 | - $ref: '#/components/schemas/User/properties/email' | |
6475 | displayName: | |
3e9e6f2f | 6476 | type: string |
77b0c6b5 RK |
6477 | description: new name of the user in its representations |
6478 | minLength: 3 | |
6479 | maxLength: 120 | |
3e9e6f2f RK |
6480 | displayNSFW: |
6481 | type: string | |
77b0c6b5 | 6482 | description: new NSFW display policy |
84f6e32c RK |
6483 | enum: |
6484 | - 'true' | |
6485 | - 'false' | |
6486 | - both | |
77b0c6b5 RK |
6487 | webTorrentEnabled: |
6488 | type: boolean | |
6489 | description: whether to enable P2P in the player or not | |
3e9e6f2f | 6490 | autoPlayVideo: |
84f6e32c | 6491 | type: boolean |
77b0c6b5 RK |
6492 | description: new preference regarding playing videos automatically |
6493 | autoPlayNextVideo: | |
6494 | type: boolean | |
6495 | description: new preference regarding playing following videos automatically | |
6496 | autoPlayNextVideoPlaylist: | |
6497 | type: boolean | |
6498 | description: new preference regarding playing following playlist videos automatically | |
6499 | videosHistoryEnabled: | |
6500 | type: boolean | |
6501 | description: whether to keep track of watched history or not | |
6502 | videoLanguages: | |
6503 | type: array | |
6504 | items: | |
6505 | type: string | |
6506 | description: list of languages to filter videos down to | |
6507 | theme: | |
6508 | type: string | |
6509 | noInstanceConfigWarningModal: | |
6510 | type: boolean | |
6511 | noWelcomeModal: | |
6512 | type: boolean | |
3e9e6f2f RK |
6513 | GetMeVideoRating: |
6514 | properties: | |
6515 | id: | |
b8375da9 | 6516 | $ref: '#/components/schemas/id' |
3e9e6f2f | 6517 | rating: |
30b40713 RK |
6518 | type: string |
6519 | enum: | |
6520 | - like | |
6521 | - dislike | |
6522 | - none | |
84f6e32c | 6523 | description: Rating of the video |
3e9e6f2f RK |
6524 | required: |
6525 | - id | |
6526 | - rating | |
c100a614 YB |
6527 | VideoRating: |
6528 | properties: | |
6529 | video: | |
6530 | $ref: '#/components/schemas/Video' | |
6531 | rating: | |
30b40713 RK |
6532 | type: string |
6533 | enum: | |
6534 | - like | |
6535 | - dislike | |
6536 | - none | |
6537 | description: Rating of the video | |
c100a614 YB |
6538 | required: |
6539 | - video | |
6540 | - rating | |
3e9e6f2f RK |
6541 | RegisterUser: |
6542 | properties: | |
6543 | username: | |
77b0c6b5 RK |
6544 | description: immutable name of the user, used to find or mention its actor |
6545 | allOf: | |
6546 | - $ref: '#/components/schemas/username' | |
3e9e6f2f | 6547 | password: |
b8375da9 | 6548 | $ref: '#/components/schemas/password' |
3e9e6f2f RK |
6549 | email: |
6550 | type: string | |
84f6e32c | 6551 | format: email |
77b0c6b5 | 6552 | description: email of the user, used for login or service communications |
1f20622f C |
6553 | displayName: |
6554 | type: string | |
77b0c6b5 | 6555 | description: editable name of the user, displayed in its representations |
84f6e32c RK |
6556 | minLength: 1 |
6557 | maxLength: 120 | |
1f20622f C |
6558 | channel: |
6559 | type: object | |
77b0c6b5 | 6560 | description: channel base information used to create the first channel of the user |
1f20622f C |
6561 | properties: |
6562 | name: | |
b8375da9 | 6563 | $ref: '#/components/schemas/usernameChannel' |
1f20622f | 6564 | displayName: |
77b0c6b5 | 6565 | $ref: '#/components/schemas/VideoChannel/properties/displayName' |
3e9e6f2f RK |
6566 | required: |
6567 | - username | |
6568 | - password | |
6569 | ||
4302058c | 6570 | |
e2464d22 RK |
6571 | OAuthClient: |
6572 | properties: | |
6573 | client_id: | |
6574 | type: string | |
6575 | pattern: /^[a-z0-9]$/ | |
6576 | maxLength: 32 | |
6577 | minLength: 32 | |
6578 | example: v1ikx5hnfop4mdpnci8nsqh93c45rldf | |
6579 | client_secret: | |
6580 | type: string | |
6581 | pattern: /^[a-zA-Z0-9]$/ | |
6582 | maxLength: 32 | |
6583 | minLength: 32 | |
6584 | example: AjWiOapPltI6EnsWQwlFarRtLh4u8tDt | |
6585 | OAuthToken-password: | |
6586 | allOf: | |
6587 | - $ref: '#/components/schemas/OAuthClient' | |
6588 | - type: object | |
6589 | properties: | |
6590 | grant_type: | |
6591 | type: string | |
6592 | enum: | |
6593 | - password | |
6594 | - refresh_token | |
6595 | default: password | |
6596 | username: | |
6597 | $ref: '#/components/schemas/User/properties/username' | |
6598 | password: | |
6599 | $ref: '#/components/schemas/password' | |
6600 | required: | |
6601 | - client_id | |
6602 | - client_secret | |
6603 | - grant_type | |
6604 | - username | |
6605 | - password | |
6606 | OAuthToken-refresh_token: | |
6607 | allOf: | |
6608 | - $ref: '#/components/schemas/OAuthClient' | |
6609 | - type: object | |
6610 | properties: | |
6611 | grant_type: | |
6612 | type: string | |
6613 | enum: | |
6614 | - password | |
6615 | - refresh_token | |
6616 | default: password | |
6617 | refresh_token: | |
6618 | type: string | |
6619 | example: 2e0d675df9fc96d2e4ec8a3ebbbf45eca9137bb7 | |
6620 | required: | |
6621 | - client_id | |
6622 | - client_secret | |
6623 | - grant_type | |
6624 | - refresh_token | |
6625 | ||
b8375da9 | 6626 | VideoChannel: |
3e9e6f2f | 6627 | properties: |
b8375da9 | 6628 | # GET/POST/PUT properties |
7d14d4d2 C |
6629 | displayName: |
6630 | type: string | |
77b0c6b5 | 6631 | description: editable name of the channel, displayed in its representations |
b8375da9 | 6632 | example: Videos of Framasoft |
4302058c RK |
6633 | minLength: 1 |
6634 | maxLength: 120 | |
3e9e6f2f RK |
6635 | description: |
6636 | type: string | |
b8375da9 | 6637 | example: Videos made with <3 by Framasoft |
4302058c RK |
6638 | minLength: 3 |
6639 | maxLength: 1000 | |
7d14d4d2 C |
6640 | support: |
6641 | type: string | |
b8375da9 | 6642 | description: text shown by default on all videos of this channel, to tell the audience how to support it |
9a320a06 | 6643 | example: Please support our work on https://soutenir.framasoft.org/en/ <3 |
4302058c RK |
6644 | minLength: 3 |
6645 | maxLength: 1000 | |
b8375da9 RK |
6646 | # GET-only properties |
6647 | id: | |
6648 | readOnly: true | |
6649 | allOf: | |
6650 | - $ref: '#/components/schemas/id' | |
6651 | isLocal: | |
6652 | readOnly: true | |
6653 | type: boolean | |
6654 | updatedAt: | |
6655 | readOnly: true | |
6656 | type: string | |
6657 | format: date-time | |
6658 | ownerAccount: | |
6659 | readOnly: true | |
6660 | nullable: true | |
6661 | type: object | |
6662 | properties: | |
6663 | id: | |
6664 | type: integer | |
6665 | uuid: | |
6666 | $ref: '#/components/schemas/UUIDv4' | |
4302058c RK |
6667 | VideoChannelCreate: |
6668 | allOf: | |
b8375da9 | 6669 | - $ref: '#/components/schemas/VideoChannel' |
4302058c RK |
6670 | - properties: |
6671 | name: | |
b8375da9 RK |
6672 | description: username of the channel to create |
6673 | allOf: | |
6674 | - $ref: '#/components/schemas/usernameChannel' | |
7d14d4d2 C |
6675 | required: |
6676 | - name | |
6677 | - displayName | |
6678 | VideoChannelUpdate: | |
4302058c | 6679 | allOf: |
b8375da9 | 6680 | - $ref: '#/components/schemas/VideoChannel' |
4302058c RK |
6681 | - properties: |
6682 | bulkVideosSupportUpdate: | |
6683 | type: boolean | |
b8375da9 | 6684 | description: Update the support field for all videos of this channel |
045bcd0d RK |
6685 | VideoChannelList: |
6686 | properties: | |
6687 | total: | |
6688 | type: integer | |
6689 | example: 1 | |
6690 | data: | |
6691 | type: array | |
6692 | items: | |
6693 | allOf: | |
6694 | - $ref: '#/components/schemas/VideoChannel' | |
6695 | - $ref: '#/components/schemas/Actor' | |
1569a818 | 6696 | |
06746a8b RK |
6697 | MRSSPeerLink: |
6698 | type: object | |
6699 | xml: | |
6700 | name: 'media:peerLink' | |
6701 | properties: | |
6702 | href: | |
6703 | type: string | |
6704 | xml: | |
6705 | attribute: true | |
6706 | type: | |
6707 | type: string | |
6708 | enum: | |
6709 | - application/x-bittorrent | |
6710 | xml: | |
6711 | attribute: true | |
6712 | MRSSGroupContent: | |
6713 | type: object | |
6714 | xml: | |
6715 | name: 'media:content' | |
6716 | properties: | |
6717 | url: | |
6718 | type: string | |
84f6e32c | 6719 | format: url |
06746a8b RK |
6720 | xml: |
6721 | attribute: true | |
6722 | fileSize: | |
6723 | type: integer | |
6724 | xml: | |
6725 | attribute: true | |
6726 | type: | |
6727 | type: string | |
6728 | xml: | |
6729 | attribute: true | |
6730 | framerate: | |
6731 | type: integer | |
6732 | xml: | |
6733 | attribute: true | |
6734 | duration: | |
6735 | type: integer | |
6736 | xml: | |
6737 | attribute: true | |
6738 | height: | |
6739 | type: integer | |
6740 | xml: | |
6741 | attribute: true | |
6742 | lang: | |
6743 | type: string | |
6744 | xml: | |
6745 | attribute: true | |
6746 | VideoCommentsForXML: | |
6747 | type: array | |
6748 | xml: | |
6749 | wrapped: true | |
6750 | name: 'channel' | |
6751 | items: | |
6752 | type: object | |
6753 | xml: | |
6754 | name: 'item' | |
6755 | properties: | |
6756 | link: | |
6757 | type: string | |
84f6e32c | 6758 | format: url |
06746a8b RK |
6759 | guid: |
6760 | type: string | |
6761 | pubDate: | |
6762 | type: string | |
6763 | format: date-time | |
6764 | 'content:encoded': | |
6765 | type: string | |
6766 | 'dc:creator': | |
6767 | type: string | |
6768 | VideosForXML: | |
6769 | type: array | |
6770 | xml: | |
6771 | wrapped: true | |
6772 | name: 'channel' | |
6773 | items: | |
6774 | type: object | |
6775 | xml: | |
6776 | name: 'item' | |
6777 | properties: | |
6778 | link: | |
6779 | type: string | |
84f6e32c | 6780 | format: url |
06746a8b RK |
6781 | description: video watch page URL |
6782 | guid: | |
6783 | type: string | |
6784 | description: video canonical URL | |
6785 | pubDate: | |
6786 | type: string | |
6787 | format: date-time | |
6788 | description: video publication date | |
6789 | description: | |
6790 | type: string | |
6791 | description: video description | |
6792 | 'content:encoded': | |
6793 | type: string | |
6794 | description: video description | |
6795 | 'dc:creator': | |
6796 | type: string | |
6797 | description: publisher user name | |
6798 | 'media:category': | |
6799 | type: integer | |
6800 | description: video category (MRSS) | |
6801 | 'media:community': | |
6802 | type: object | |
6803 | description: see [media:community](https://www.rssboard.org/media-rss#media-community) (MRSS) | |
6804 | properties: | |
6805 | 'media:statistics': | |
6806 | type: object | |
6807 | properties: | |
6808 | views: | |
6809 | type: integer | |
6810 | xml: | |
6811 | attribute: true | |
6812 | 'media:embed': | |
6813 | type: object | |
6814 | properties: | |
6815 | url: | |
6816 | type: string | |
84f6e32c | 6817 | format: url |
06746a8b RK |
6818 | description: video embed path, relative to the canonical URL domain (MRSS) |
6819 | xml: | |
6820 | attribute: true | |
6821 | 'media:player': | |
6822 | type: object | |
6823 | properties: | |
6824 | url: | |
6825 | type: string | |
84f6e32c | 6826 | format: url |
06746a8b RK |
6827 | description: video watch path, relative to the canonical URL domain (MRSS) |
6828 | xml: | |
6829 | attribute: true | |
6830 | 'media:thumbnail': | |
6831 | type: object | |
6832 | properties: | |
6833 | url: | |
6834 | type: string | |
84f6e32c | 6835 | format: url |
06746a8b RK |
6836 | xml: |
6837 | attribute: true | |
6838 | height: | |
6839 | type: integer | |
6840 | xml: | |
6841 | attribute: true | |
6842 | width: | |
6843 | type: integer | |
6844 | xml: | |
6845 | attribute: true | |
6846 | 'media:title': | |
6847 | type: string | |
6848 | description: see [media:title](https://www.rssboard.org/media-rss#media-title) (MRSS). We only use `plain` titles. | |
6849 | 'media:description': | |
6850 | type: string | |
6851 | 'media:rating': | |
6852 | type: string | |
6853 | enum: | |
6854 | - nonadult | |
6855 | - adult | |
6856 | description: see [media:rating](https://www.rssboard.org/media-rss#media-rating) (MRSS) | |
6857 | 'enclosure': | |
6858 | type: object | |
6859 | description: main streamable file for the video | |
6860 | properties: | |
6861 | url: | |
6862 | type: string | |
84f6e32c | 6863 | format: url |
06746a8b RK |
6864 | xml: |
6865 | attribute: true | |
6866 | type: | |
6867 | type: string | |
6868 | enum: | |
6869 | - application/x-bittorrent | |
6870 | xml: | |
6871 | attribute: true | |
6872 | length: | |
6873 | type: integer | |
6874 | xml: | |
6875 | attribute: true | |
6876 | 'media:group': | |
6877 | type: array | |
6878 | 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) | |
6879 | items: | |
6880 | anyOf: | |
6881 | - $ref: '#/components/schemas/MRSSPeerLink' | |
f4d59981 RK |
6882 | - $ref: '#/components/schemas/MRSSGroupContent' |
6883 | NotificationSettingValue: | |
6884 | type: integer | |
6885 | description: > | |
6886 | Notification type | |
84f6e32c | 6887 | |
f4d59981 | 6888 | - `0` NONE |
84f6e32c | 6889 | |
f4d59981 | 6890 | - `1` WEB |
84f6e32c | 6891 | |
f4d59981 RK |
6892 | - `2` EMAIL |
6893 | enum: | |
6894 | - 0 | |
6895 | - 1 | |
6896 | - 3 | |
6897 | Notification: | |
6898 | properties: | |
6899 | id: | |
b8375da9 | 6900 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6901 | type: |
6902 | type: integer | |
6903 | description: > | |
6904 | Notification type, following the `UserNotificationType` enum: | |
84f6e32c | 6905 | |
f4d59981 | 6906 | - `1` NEW_VIDEO_FROM_SUBSCRIPTION |
84f6e32c | 6907 | |
f4d59981 | 6908 | - `2` NEW_COMMENT_ON_MY_VIDEO |
84f6e32c | 6909 | |
310b5219 | 6910 | - `3` NEW_ABUSE_FOR_MODERATORS |
84f6e32c | 6911 | |
f4d59981 | 6912 | - `4` BLACKLIST_ON_MY_VIDEO |
84f6e32c | 6913 | |
f4d59981 | 6914 | - `5` UNBLACKLIST_ON_MY_VIDEO |
84f6e32c | 6915 | |
f4d59981 | 6916 | - `6` MY_VIDEO_PUBLISHED |
84f6e32c | 6917 | |
f4d59981 | 6918 | - `7` MY_VIDEO_IMPORT_SUCCESS |
84f6e32c | 6919 | |
f4d59981 | 6920 | - `8` MY_VIDEO_IMPORT_ERROR |
84f6e32c | 6921 | |
f4d59981 | 6922 | - `9` NEW_USER_REGISTRATION |
84f6e32c | 6923 | |
f4d59981 | 6924 | - `10` NEW_FOLLOW |
84f6e32c | 6925 | |
f4d59981 | 6926 | - `11` COMMENT_MENTION |
84f6e32c | 6927 | |
f4d59981 | 6928 | - `12` VIDEO_AUTO_BLACKLIST_FOR_MODERATORS |
84f6e32c | 6929 | |
f4d59981 | 6930 | - `13` NEW_INSTANCE_FOLLOWER |
84f6e32c | 6931 | |
f4d59981 RK |
6932 | - `14` AUTO_INSTANCE_FOLLOWING |
6933 | read: | |
6934 | type: boolean | |
6935 | video: | |
6936 | nullable: true | |
6937 | allOf: | |
6938 | - $ref: '#/components/schemas/VideoInfo' | |
6939 | - type: object | |
6940 | properties: | |
6941 | channel: | |
6942 | $ref: '#/components/schemas/ActorInfo' | |
6943 | videoImport: | |
6944 | nullable: true | |
6945 | type: object | |
6946 | properties: | |
6947 | id: | |
b8375da9 | 6948 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6949 | video: |
6950 | nullable: true | |
6951 | $ref: '#/components/schemas/VideoInfo' | |
6952 | torrentName: | |
6953 | type: string | |
6954 | nullable: true | |
6955 | magnetUri: | |
2c4876f2 | 6956 | $ref: '#/components/schemas/VideoImport/properties/magnetUri' |
f4d59981 RK |
6957 | targetUri: |
6958 | type: string | |
84f6e32c | 6959 | format: uri |
f4d59981 RK |
6960 | nullable: true |
6961 | comment: | |
6962 | nullable: true | |
6963 | type: object | |
6964 | properties: | |
6965 | id: | |
b8375da9 | 6966 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6967 | threadId: |
6968 | type: integer | |
6969 | video: | |
6970 | $ref: '#/components/schemas/VideoInfo' | |
6971 | account: | |
6972 | $ref: '#/components/schemas/ActorInfo' | |
6973 | videoAbuse: | |
6974 | nullable: true | |
6975 | type: object | |
6976 | properties: | |
6977 | id: | |
b8375da9 | 6978 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6979 | video: |
6980 | allOf: | |
6981 | - $ref: '#/components/schemas/VideoInfo' | |
6982 | videoBlacklist: | |
6983 | nullable: true | |
6984 | type: object | |
6985 | properties: | |
6986 | id: | |
b8375da9 | 6987 | $ref: '#/components/schemas/id' |
f4d59981 RK |
6988 | video: |
6989 | allOf: | |
6990 | - $ref: '#/components/schemas/VideoInfo' | |
6991 | account: | |
6992 | nullable: true | |
6993 | allOf: | |
6994 | - $ref: '#/components/schemas/ActorInfo' | |
6995 | actorFollow: | |
6996 | type: object | |
6997 | nullable: true | |
6998 | properties: | |
6999 | id: | |
b8375da9 | 7000 | $ref: '#/components/schemas/id' |
f4d59981 RK |
7001 | follower: |
7002 | $ref: '#/components/schemas/ActorInfo' | |
7003 | state: | |
7004 | type: string | |
7005 | enum: | |
7006 | - pending | |
7007 | - accepted | |
7008 | following: | |
7009 | type: object | |
7010 | properties: | |
7011 | type: | |
7012 | type: string | |
7013 | enum: | |
7014 | - account | |
7015 | - channel | |
7016 | - instance | |
7017 | name: | |
7018 | type: string | |
7019 | displayName: | |
7020 | type: string | |
7021 | host: | |
7022 | type: string | |
84f6e32c | 7023 | format: hostname |
f4d59981 RK |
7024 | createdAt: |
7025 | type: string | |
7026 | format: date-time | |
7027 | updatedAt: | |
7028 | type: string | |
7029 | format: date-time | |
7030 | NotificationListResponse: | |
7031 | properties: | |
7032 | total: | |
7033 | type: integer | |
84f6e32c | 7034 | example: 1 |
f4d59981 RK |
7035 | data: |
7036 | type: array | |
84f6e32c | 7037 | maxItems: 100 |
f4d59981 | 7038 | items: |
7461d440 RK |
7039 | $ref: '#/components/schemas/Notification' |
7040 | Plugin: | |
7041 | properties: | |
7042 | name: | |
7043 | type: string | |
84f6e32c | 7044 | example: peertube-plugin-auth-ldap |
7461d440 RK |
7045 | type: |
7046 | type: integer | |
84f6e32c RK |
7047 | description: > |
7048 | - `1`: PLUGIN | |
7049 | ||
7050 | - `2`: THEME | |
7461d440 RK |
7051 | enum: |
7052 | - 1 | |
7053 | - 2 | |
7054 | latestVersion: | |
7055 | type: string | |
84f6e32c | 7056 | example: 0.0.3 |
7461d440 RK |
7057 | version: |
7058 | type: string | |
84f6e32c | 7059 | example: 0.0.1 |
7461d440 RK |
7060 | enabled: |
7061 | type: boolean | |
7062 | uninstalled: | |
7063 | type: boolean | |
7064 | peertubeEngine: | |
7065 | type: string | |
84f6e32c | 7066 | example: 2.2.0 |
7461d440 RK |
7067 | description: |
7068 | type: string | |
7069 | homepage: | |
7070 | type: string | |
84f6e32c RK |
7071 | format: url |
7072 | example: https://framagit.org/framasoft/peertube/official-plugins/tree/master/peertube-plugin-auth-ldap | |
7461d440 RK |
7073 | settings: |
7074 | type: object | |
7075 | additionalProperties: true | |
7076 | createdAt: | |
7077 | type: string | |
7078 | format: date-time | |
7079 | updatedAt: | |
7080 | type: string | |
7081 | format: date-time | |
7082 | PluginResponse: | |
7083 | properties: | |
7084 | total: | |
7085 | type: integer | |
84f6e32c | 7086 | example: 1 |
7461d440 RK |
7087 | data: |
7088 | type: array | |
84f6e32c | 7089 | maxItems: 100 |
7461d440 | 7090 | items: |
2c318664 | 7091 | $ref: '#/components/schemas/Plugin' |
4e239e35 C |
7092 | |
7093 | LiveVideoUpdate: | |
7094 | properties: | |
7095 | saveReplay: | |
7096 | type: boolean | |
bb4ba6d9 C |
7097 | permanentLive: |
7098 | description: User can stream multiple times in a permanent live | |
7099 | type: boolean | |
4e239e35 C |
7100 | |
7101 | LiveVideoResponse: | |
7102 | properties: | |
7103 | rtmpUrl: | |
7104 | type: string | |
7105 | streamKey: | |
7106 | type: string | |
7107 | description: RTMP stream key to use to stream into this live video | |
7108 | saveReplay: | |
7109 | type: boolean | |
bb4ba6d9 C |
7110 | permanentLive: |
7111 | description: User can stream multiple times in a permanent live | |
7112 | type: boolean | |
4e239e35 | 7113 | |
75cba40d C |
7114 | |
7115 | ||
2c318664 RK |
7116 | callbacks: |
7117 | searchIndex: | |
c00f96ce | 7118 | 'https://search.example.org/api/v1/search/videos': |
2c318664 RK |
7119 | post: |
7120 | summary: third-party search index MAY be used instead of the local index, if enabled by the instance admin. see `searchTarget` | |
7121 | responses: | |
7122 | '200': | |
7123 | description: successful operation | |
7124 | content: | |
7125 | application/json: | |
7126 | schema: | |
1e904cde | 7127 | $ref: '#/components/schemas/VideoListResponse' |