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