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